Click or drag to resize
MimeKit

AsymmetricAlgorithmExtensionsAsAsymmetricCipherKeyPair Method

Convert an AsymmetricAlgorithm into a BouncyCastle AsymmetricCipherKeyPair.

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

Parameters

key  AsymmetricAlgorithm
The key.

Return Value

AsymmetricCipherKeyPair
The Bouncy Castle AsymmetricCipherKeyPair.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type AsymmetricAlgorithm. 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.
ArgumentExceptionkey is a public key.
NotSupportedExceptionkey is an unsupported asymmetric algorithm.
Remarks

Converts an AsymmetricAlgorithm into a BouncyCastle AsymmetricCipherKeyPair.

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