Click or drag to resize
MimeKit

AsymmetricAlgorithmExtensionsAsAsymmetricKeyParameter Method

Convert an AsymmetricAlgorithm into a BouncyCastle AsymmetricKeyParameter.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public static AsymmetricKeyParameter AsAsymmetricKeyParameter(
	this AsymmetricAlgorithm key
)

Parameters

key  AsymmetricAlgorithm
The key.

Return Value

AsymmetricKeyParameter
The Bouncy Castle AsymmetricKeyParameter.

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.
NotSupportedExceptionkey is an unsupported asymmetric algorithm.
Remarks

Converts an AsymmetricAlgorithm into a BouncyCastle AsymmetricKeyParameter.

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