C# Class Internal.Cryptography.CngSymmetricAlgorithmCore

Show file Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
CreateCryptoTransform ICryptoTransform
CreateCryptoTransform ICryptoTransform
CreateEphemeralCryptoTransformCore ICryptoTransform
CreatePersistedCryptoTransformCore ICryptoTransform
ProduceCngKey System.Security.Cryptography.CngKey

Public Methods

Method Description
CngSymmetricAlgorithmCore ( ICngSymmetricAlgorithm outer ) : System

Configures the core to use plaintext keys (to be auto-generated when first needed.)

CngSymmetricAlgorithmCore ( ICngSymmetricAlgorithm outer, string keyName, CngProvider provider, CngKeyOpenOptions openOptions ) : System

Constructs the core to use a stored CNG key.

CreateDecryptor ( ) : ICryptoTransform
CreateDecryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
CreateEncryptor ( ) : ICryptoTransform
CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
GenerateIV ( ) : void
GenerateKey ( ) : void
GetKeyIfExportable ( ) : byte[]

Note! This can and likely will throw if the algorithm was given a hardware-based key.

SetKey ( byte key ) : void
SetKeySize ( int keySize, ICngSymmetricAlgorithm outer ) : void

Private Methods

Method Description
CreateCryptoTransform ( bool encrypting ) : ICryptoTransform
CreateCryptoTransform ( byte rgbKey, byte rgbIV, bool encrypting ) : ICryptoTransform
CreateEphemeralCryptoTransformCore ( byte key, byte iv, bool encrypting ) : ICryptoTransform
CreatePersistedCryptoTransformCore ( Func cngKeyFactory, byte iv, bool encrypting ) : ICryptoTransform
ProduceCngKey ( ) : System.Security.Cryptography.CngKey

Method Details

CngSymmetricAlgorithmCore() public method

Configures the core to use plaintext keys (to be auto-generated when first needed.)
public CngSymmetricAlgorithmCore ( ICngSymmetricAlgorithm outer ) : System
outer ICngSymmetricAlgorithm
return System

CngSymmetricAlgorithmCore() public method

Constructs the core to use a stored CNG key.
public CngSymmetricAlgorithmCore ( ICngSymmetricAlgorithm outer, string keyName, CngProvider provider, CngKeyOpenOptions openOptions ) : System
outer ICngSymmetricAlgorithm
keyName string
provider CngProvider
openOptions CngKeyOpenOptions
return System

CreateDecryptor() public method

public CreateDecryptor ( ) : ICryptoTransform
return ICryptoTransform

CreateDecryptor() public method

public CreateDecryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte
rgbIV byte
return ICryptoTransform

CreateEncryptor() public method

public CreateEncryptor ( ) : ICryptoTransform
return ICryptoTransform

CreateEncryptor() public method

public CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte
rgbIV byte
return ICryptoTransform

GenerateIV() public method

public GenerateIV ( ) : void
return void

GenerateKey() public method

public GenerateKey ( ) : void
return void

GetKeyIfExportable() public method

Note! This can and likely will throw if the algorithm was given a hardware-based key.
public GetKeyIfExportable ( ) : byte[]
return byte[]

SetKey() public method

public SetKey ( byte key ) : void
key byte
return void

SetKeySize() public method

public SetKeySize ( int keySize, ICngSymmetricAlgorithm outer ) : void
keySize int
outer ICngSymmetricAlgorithm
return void