<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Security.DotNetUtilities

public static class DotNetUtilities
A class containing methods to interface the BouncyCastle world to the .NET Crypto world.

Create a Bouncy Castle X509Certificate from a .NET X509Certificate.

Create a Bouncy Castle X509Certificate from a .NET X509Certificate2.

Extract a DSA key pair from a .NET DSA object.

Extract a DSA key pair from DSAParameters.

Extract DSA public key parameters from a .NET DSA object.

Extract DSA public key parameters from DSAParameters.

Extract an EC key pair from a .NET ECDsa object.

Extract EC public key parameters from a .NET ECDsa object.

public static AsymmetricCipherKeyPair GetECKeyPair(string algorithm, ECParameters ec)

Extract an EC key pair from ECParameters.

public static ECPublicKeyParameters GetECPublicKey(string algorithm, ECParameters ec)

Extract EC public key parameters from ECParameters.

Extract an asymmetric key pair from a .NET AsymmetricAlgorithm object.

Extract an RSA key pair from a .NET RSA object.

Extract an RSA key pair from RSAParameters.

Extract RSA public key parameters from a .NET RSA object.

Extract RSA public key parameters from RSAParameters.

Extract the SubjectPublicKeyInfo (an X.509 ASN.1 type used for public keys) from a .NET X509Certificate2.

public static byte[] GetSubjectPublicKeyInfoDer(X509Certificate2 certificate)

Extract the DER-encoded SubjectPublicKeyInfo bytes from a .NET X509Certificate2.

public static RSA ToRSA(RsaKeyParameters rsaKey)

Create a .NET RSA instance from Bouncy Castle RSA public key parameters.

public static RSA ToRSA(RsaKeyParameters rsaKey, CspParameters csp)

Create a .NET RSA instance from Bouncy Castle RSA public key parameters.

public static RSA ToRSA(RsaPrivateCrtKeyParameters privKey)

Create a .NET RSA instance from Bouncy Castle RSA private CRT parameters.

public static RSA ToRSA(RsaPrivateCrtKeyParameters privKey, CspParameters csp)

Create a .NET RSA instance from Bouncy Castle RSA private CRT parameters and CSP info.

public static RSA ToRSA(RsaPrivateKeyStructure privKey)

Create a .NET RSA instance from Bouncy Castle RSA private CRT structure.

public static RSA ToRSA(RsaPrivateKeyStructure privKey, CspParameters csp)

Create a .NET RSA instance from Bouncy Castle RSA private CRT structure and CSP info.

Convert Bouncy Castle RSA public key parameters to .NET RSAParameters.

Convert Bouncy Castle RSA private CRT parameters to .NET RSAParameters.

Convert Bouncy Castle RSA private CRT structure to .NET RSAParameters.

Create an System.Security.Cryptography.X509Certificate from an X509CertificateStructure.

Create an System.Security.Cryptography.X509Certificate from an X509Certificate.