Click or drag to resize
MimeKit

AsymmetricAlgorithmExtensionsAsAsymmetricAlgorithm(AsymmetricKeyParameter) Method

Convert a BouncyCastle AsymmetricKeyParameter into an AsymmetricAlgorithm.

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

Parameters

key  AsymmetricKeyParameter
The AsymmetricKeyParameter.

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 AsymmetricKeyParameter. 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 key parameter.
Remarks

Converts a BouncyCastle AsymmetricKeyParameter into an AsymmetricAlgorithm.

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