C# Класс Dse.Auth.Sspi.Contexts.Context

Represents a security context and provides common functionality required for all security contexts.
This class is abstract and has a protected constructor and Initialize method. The exact initialization implementation is provided by a subclasses, which may perform initialization in a variety of manners.
Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
Decrypt ( byte input ) : byte[]

Decrypts a previously encrypted message.

The expected format of the buffer is as follows: - 2 bytes, an unsigned big-endian integer indicating the length of the trailer buffer size - 4 bytes, an unsigned big-endian integer indicating the length of the message buffer size. - 2 bytes, an unsigned big-endian integer indicating the length of the encryption padding buffer size. - The trailer buffer - The message buffer - The padding buffer.

Dispose ( ) : void

Releases all resources associated with the context.

Encrypt ( byte input ) : byte[]

Encrypts the byte array using the context's session key.

The structure of the returned data is as follows: - 2 bytes, an unsigned big-endian integer indicating the length of the trailer buffer size - 4 bytes, an unsigned big-endian integer indicating the length of the message buffer size. - 2 bytes, an unsigned big-endian integer indicating the length of the encryption padding buffer size. - The trailer buffer - The message buffer - The padding buffer.

MakeSignature ( byte message ) : byte[]

Signs the message using the context's session key.

The structure of the returned buffer is as follows: - 4 bytes, unsigned big-endian integer indicating the length of the plaintext message - 2 bytes, unsigned big-endian integer indicating the length of the signture - The plaintext message - The message's signature.

VerifySignature ( byte signedMessage, byte &origMessage ) : bool

Verifies the signature of a signed message

The expected structure of the signed message buffer is as follows: - 4 bytes, unsigned integer in big endian format indicating the length of the plaintext message - 2 bytes, unsigned integer in big endian format indicating the length of the signture - The plaintext message - The message's signature.

Защищенные методы

Метод Описание
Context ( Credential cred ) : System

Performs basic initialization of a new instance of the Context class. Initialization is not complete until the ContextHandle property has been set and the Initialize method has been called.

Dispose ( bool disposing ) : void

Releases resources associated with the context.

Initialize ( System.DateTime expiry ) : void

Marks the context as having completed the initialization process, ie, exchanging of authentication tokens.

Приватные методы

Метод Описание
CheckLifecycle ( ) : void

Verifies that the object's lifecycle (initialization / disposition) state is suitable for using the object.

QueryBufferSizes ( ) : SecPkgContext_Sizes

Queries the security package's expections regarding message/token/signature/padding buffer sizes.

QueryContextString ( ContextQueryAttrib attrib ) : string

Queries a string-valued context attribute by the named attribute.

Описание методов

Context() защищенный Метод

Performs basic initialization of a new instance of the Context class. Initialization is not complete until the ContextHandle property has been set and the Initialize method has been called.
protected Context ( Credential cred ) : System
cred Dse.Auth.Sspi.Credentials.Credential
Результат System

Decrypt() публичный Метод

Decrypts a previously encrypted message.
The expected format of the buffer is as follows: - 2 bytes, an unsigned big-endian integer indicating the length of the trailer buffer size - 4 bytes, an unsigned big-endian integer indicating the length of the message buffer size. - 2 bytes, an unsigned big-endian integer indicating the length of the encryption padding buffer size. - The trailer buffer - The message buffer - The padding buffer.
public Decrypt ( byte input ) : byte[]
input byte The packed and encrypted data.
Результат byte[]

Dispose() публичный Метод

Releases all resources associated with the context.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases resources associated with the context.
protected Dispose ( bool disposing ) : void
disposing bool If true, release managed resources, else release only unmanaged resources.
Результат void

Encrypt() публичный Метод

Encrypts the byte array using the context's session key.
The structure of the returned data is as follows: - 2 bytes, an unsigned big-endian integer indicating the length of the trailer buffer size - 4 bytes, an unsigned big-endian integer indicating the length of the message buffer size. - 2 bytes, an unsigned big-endian integer indicating the length of the encryption padding buffer size. - The trailer buffer - The message buffer - The padding buffer.
public Encrypt ( byte input ) : byte[]
input byte The raw message to encrypt.
Результат byte[]

Initialize() защищенный Метод

Marks the context as having completed the initialization process, ie, exchanging of authentication tokens.
protected Initialize ( System.DateTime expiry ) : void
expiry System.DateTime The date and time that the context will expire.
Результат void

MakeSignature() публичный Метод

Signs the message using the context's session key.
The structure of the returned buffer is as follows: - 4 bytes, unsigned big-endian integer indicating the length of the plaintext message - 2 bytes, unsigned big-endian integer indicating the length of the signture - The plaintext message - The message's signature.
public MakeSignature ( byte message ) : byte[]
message byte
Результат byte[]

VerifySignature() публичный Метод

Verifies the signature of a signed message
The expected structure of the signed message buffer is as follows: - 4 bytes, unsigned integer in big endian format indicating the length of the plaintext message - 2 bytes, unsigned integer in big endian format indicating the length of the signture - The plaintext message - The message's signature.
public VerifySignature ( byte signedMessage, byte &origMessage ) : bool
signedMessage byte The packed signed message.
origMessage byte The extracted original message.
Результат bool