Esempio n. 1
0
        /// <summary>
        /// Performs basic initialization of a new instance of the ServerContext class. The ServerContext
        /// is not ready for message manipulation until a security context has been established with a client.
        /// </summary>
        /// <param name="cred"></param>
        /// <param name="requestedAttribs"></param>
        public ServerContext(ServerCredential cred, ContextAttrib requestedAttribs) : base(cred)
        {
            this.requestedAttribs = requestedAttribs;
            this.finalAttribs     = ContextAttrib.Zero;

            this.impersonating = false;

            this.SupportsImpersonate = this.Credential.PackageInfo.Capabilities.HasFlag(SecPkgCapability.Impersonation);
        }
 internal static extern SecurityStatus AcceptSecurityContext_2(
     ref RawSspiHandle credHandle,
     ref RawSspiHandle oldContextHandle,
     IntPtr inputBuffer,
     ContextAttrib requestedAttribs,
     SecureBufferDataRep dataRep,
     ref RawSspiHandle newContextHandle,
     IntPtr outputBuffer,
     ref ContextAttrib outputAttribs,
     ref TimeStamp expiry
     );
 internal static extern SecurityStatus AcceptSecurityContext_1(
     ref RawSspiHandle credHandle,
     IntPtr oldContextHandle,
     IntPtr inputBuffer,
     ContextAttrib requestedAttribs,
     SecureBufferDataRep dataRep,
     ref RawSspiHandle newContextHandle,
     IntPtr outputBuffer,
     ref ContextAttrib outputAttribs,
     ref TimeStamp expiry
 );
 internal static extern SecurityStatus InitializeSecurityContext_1(
     ref RawSspiHandle credentialHandle,
     IntPtr zero,
     string serverPrincipleName,
     ContextAttrib requiredAttribs,
     int reserved1,
     SecureBufferDataRep dataRep,
     IntPtr inputBuffer,
     int reserved2,
     ref RawSspiHandle newContextHandle,
     IntPtr outputBuffer,
     ref ContextAttrib contextAttribs,
     ref TimeStamp expiry
     );
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the ClientContext class. The context is not fully initialized and usable
 /// until the authentication cycle has been completed.
 /// </summary>
 /// <param name="cred">The security credential to authenticate as.</param>
 /// <param name="serverPrinc">The principle name of the server to connect to, or null for any.</param>
 /// <param name="requestedAttribs">Requested attributes that describe the desired properties of the
 /// context once it is established. If a context cannot be established that satisfies the indicated
 /// properties, the context initialization is aborted.</param>
 public ClientContext(ClientCredential cred, string serverPrinc, ContextAttrib requestedAttribs)
     : base(cred)
 {
     this.serverPrinc      = serverPrinc;
     this.requestedAttribs = requestedAttribs;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the ClientContext class. The context is not fully initialized and usable
 /// until the authentication cycle has been completed.
 /// </summary>
 /// <param name="cred">The security credential to authenticate as.</param>
 /// <param name="serverPrinc">The principle name of the server to connect to, or null for any.</param>
 /// <param name="requestedAttribs">Requested attributes that describe the desired properties of the
 /// context once it is established. If a context cannot be established that satisfies the indicated
 /// properties, the context initialization is aborted.</param>
 public ClientContext( ClientCredential cred, string serverPrinc, ContextAttrib requestedAttribs )
     : base(cred)
 {
     this.serverPrinc = serverPrinc;
     this.requestedAttribs = requestedAttribs;
 }
 internal static extern SecurityStatus InitializeSecurityContext_1(
     ref RawSspiHandle credentialHandle,
     IntPtr zero,
     string serverPrincipleName,
     ContextAttrib requiredAttribs,
     int reserved1,
     SecureBufferDataRep dataRep,
     IntPtr inputBuffer,
     int reserved2,
     ref RawSspiHandle newContextHandle,
     IntPtr outputBuffer,
     ref ContextAttrib contextAttribs,
     ref TimeStamp expiry
 );