Click or drag to resize
MimeKit

AsymmetricAlgorithmExtensionsAsAsymmetricAlgorithm(AsymmetricCipherKeyPair) Method

Convert a BouncyCastle AsymmetricCipherKeyPair into an AsymmetricAlgorithm.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public static AsymmetricAlgorithm AsAsymmetricAlgorithm(
	this AsymmetricCipherKeyPair key
)

Parameters

key  AsymmetricCipherKeyPair
The AsymmetricCipherKeyPair.

Return Value

AsymmetricAlgorithm
The AsymmetricAlgorithm.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type AsymmetricCipherKeyPair. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is null.
NotSupportedExceptionkey is an unsupported asymmetric algorithm.
Remarks

Converts a BouncyCastle AsymmetricCipherKeyPair into an AsymmetricAlgorithm.

Note  Note
Currently, only RSA and DSA keys are supported.
See Also