This project has moved and is read-only. For the latest updates, please go here.

System.Security.Cryptography.SymmetricAlgorithm

Several extension methods for the SymmetricAlgorithm class are provided in the SymmetricAlgorihmExtensionMethods type. This type is in the Security.Cryptography namespace (not the System.Security.Cryptography namespace), so in order to use these extension methods, you will need to make sure you include this namespace as well as a reference to Security.Cryptography.Debug.dll.

APIs

SymmetricAlgorithm SymmetricAlgorithm::EnableLogging()

Creates a symmetric algorithm object that will log all of the input parameters to encryption and allow access to a SymmetricEncryptionState object that will enable decryption verification. The symmetric algorithm created with this method will not check for correct multi-threaded access to an encryption object.

SymmetricAlgorithm SymmetricAlgorithm::EnableLogging(Security.Cryptography.SymmetricAlgorithmDiagnosticOptions diagnosticOptions)

Arguments:
diagnosticOptions options for customizing the diagnostic logging


Exceptions:
ArgumentNullException if diagnosticOptions is null


Creates a symmetric algorithm object that will log all of the input parameters to encryption and allow access to a SymmetricEncryptionState object that will enable decryption verification.

SymmetricAlgorithm SymmetricAlgorithm::EnableDecryptionVerification(Security.Cryptography.SymmetricEncryptionState encryptionState)

Arguments:
encryptionState diagnostic state captured during the encryption operation


Exceptions:
ArgumentNullException if encryptionState is null


Creates a symmetric algorithm object that will throw a CryptographicDiagnosticException if decryption parameters do not match up with the encryptionState values. The symmetric algorithm created with this method will not check for correct multi-threaded access to a decryption object.

SymmetricAlgorithm SymmetricAlgorithm::EnableDecryptionVerification(Security.Cryptography.SymmetricEncryptionState encryptionState, Security.Cryptography.SymmetricAlgorithmDiagnosticOptions diagnosticOptions)

Arguments:
encryptionState diagnostic state captured during the encryption operation
diagnosticOptions options for customizing the diagnostic logging


Exceptions:
ArgumentNullException if encryptionState or diagnosticOptions are null


Creates a symmetric algorithm object that will throw a CryptographicDiagnosticException if decryption parameters do not match up with the encryptionState values.

Security.Cryptography.SymmetricEncryptionState SymmetricAlgorithm::GetLastEncryptionState()

Exceptions:
InvalidOperationException if the algorithm that GetLastEncryptionState is called on was not returned by one of the EnableLogging methods, or if an encryptor has not yet been created by the logged algorithm


Gets the most current encryption state that was used to create an encryptor for a logged symmetric algorithm. This object can be passed to the EnableDecryptionVerification method in order to enable checking that the decryption parameters match the encryption parameters.

Last edited Jun 30, 2008 at 1:02 AM by shawnfa, version 2

Comments

No comments yet.