Asymmetric Algorithm ExtensionsAs Asymmetric Cipher Key Pair Method
Convert an AsymmetricAlgorithm into a BouncyCastle AsymmetricCipherKeyPair.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
The Bouncy Castle AsymmetricCipherKeyPair.
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public static AsymmetricCipherKeyPair AsAsymmetricCipherKeyPair(
this AsymmetricAlgorithm key
)Parameters
- key AsymmetricAlgorithm
- The key.
Return Value
AsymmetricCipherKeyPairThe 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).Remarks
Converts an AsymmetricAlgorithm into a BouncyCastle AsymmetricCipherKeyPair.
Exceptions
| ArgumentNullException | key is . |
| ArgumentException | key is a public key. |
| NotSupportedException | key is an unsupported asymmetric algorithm. |