C# Class OpenSSL.Crypto.CipherContext

Wraps the EVP_CIPHER_CTX object.
Inheritance: OpenSSL.Core.Base, IDisposable
Afficher le fichier Open project: langhuihui/csharprtmp Class Usage Examples

Méthodes publiques

Méthode Description
BytesToKey ( OpenSSL.Crypto.MessageDigest md, byte salt, byte data, int count, byte &iv ) : byte[]

Calls EVP_BytesToKey

CipherContext ( Cipher cipher ) : System

Calls OPENSSL_malloc() and initializes the buffer using EVP_CIPHER_CTX_init()

Crypt ( byte input, byte key, byte iv, bool doEncrypt ) : byte[]

Encrypts or decrypts the specified payload.

Crypt ( byte input, byte key, byte iv, bool doEncrypt, int padding ) : byte[]

Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex()

Crypt ( byte input, int count, byte key, byte iv, bool doEncrypt, int padding ) : byte[]

Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex()

Decrypt ( byte input, byte key, byte iv ) : byte[]

Decrypts the specified ciphertext

Decrypt ( byte input, byte key, byte iv, int padding ) : byte[]

Decrypts the specified ciphertext

Encrypt ( byte input, byte key, byte iv ) : byte[]

Encrypts the specified plaintext

Encrypt ( byte input, byte key, byte iv, int padding ) : byte[]

Encrypts the specified plaintext

Open ( byte input, byte ekey, byte iv, OpenSSL.Crypto.CryptoKey pkey ) : byte[]

Calls EVP_OpenInit() and EVP_OpenFinal()

Print ( BIO bio ) : void

Returns the cipher's LongName

Seal ( OpenSSL.Crypto.CryptoKey pkeys, byte input ) : Envelope

Calls EVP_SealInit() and EVP_SealFinal()

Méthodes protégées

Méthode Description
OnDispose ( ) : void

Calls EVP_CIPHER_CTX_clean() and then OPENSSL_free()

Private Methods

Méthode Description
SetupIV ( byte iv ) : byte[]
SetupKey ( byte key ) : byte[]

Method Details

BytesToKey() public méthode

Calls EVP_BytesToKey
public BytesToKey ( OpenSSL.Crypto.MessageDigest md, byte salt, byte data, int count, byte &iv ) : byte[]
md OpenSSL.Crypto.MessageDigest
salt byte
data byte
count int
iv byte
Résultat byte[]

CipherContext() public méthode

Calls OPENSSL_malloc() and initializes the buffer using EVP_CIPHER_CTX_init()
public CipherContext ( Cipher cipher ) : System
cipher Cipher
Résultat System

Crypt() public méthode

Encrypts or decrypts the specified payload.
public Crypt ( byte input, byte key, byte iv, bool doEncrypt ) : byte[]
input byte
key byte
iv byte
doEncrypt bool
Résultat byte[]

Crypt() public méthode

Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex()
public Crypt ( byte input, byte key, byte iv, bool doEncrypt, int padding ) : byte[]
input byte
key byte
iv byte
doEncrypt bool
padding int
Résultat byte[]

Crypt() public méthode

Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex()
public Crypt ( byte input, int count, byte key, byte iv, bool doEncrypt, int padding ) : byte[]
input byte
count int
key byte
iv byte
doEncrypt bool
padding int
Résultat byte[]

Decrypt() public méthode

Decrypts the specified ciphertext
public Decrypt ( byte input, byte key, byte iv ) : byte[]
input byte
key byte
iv byte
Résultat byte[]

Decrypt() public méthode

Decrypts the specified ciphertext
public Decrypt ( byte input, byte key, byte iv, int padding ) : byte[]
input byte
key byte
iv byte
padding int
Résultat byte[]

Encrypt() public méthode

Encrypts the specified plaintext
public Encrypt ( byte input, byte key, byte iv ) : byte[]
input byte
key byte
iv byte
Résultat byte[]

Encrypt() public méthode

Encrypts the specified plaintext
public Encrypt ( byte input, byte key, byte iv, int padding ) : byte[]
input byte
key byte
iv byte
padding int
Résultat byte[]

OnDispose() protected méthode

Calls EVP_CIPHER_CTX_clean() and then OPENSSL_free()
protected OnDispose ( ) : void
Résultat void

Open() public méthode

Calls EVP_OpenInit() and EVP_OpenFinal()
public Open ( byte input, byte ekey, byte iv, OpenSSL.Crypto.CryptoKey pkey ) : byte[]
input byte
ekey byte
iv byte
pkey OpenSSL.Crypto.CryptoKey
Résultat byte[]

Print() public méthode

Returns the cipher's LongName
public Print ( BIO bio ) : void
bio OpenSSL.Core.BIO
Résultat void

Seal() public méthode

Calls EVP_SealInit() and EVP_SealFinal()
public Seal ( OpenSSL.Crypto.CryptoKey pkeys, byte input ) : Envelope
pkeys OpenSSL.Crypto.CryptoKey
input byte
Résultat Envelope