A class containing methods to interface the BouncyCastle world to the .NET Crypto world.
Ejemplo n.º 1
0
 public static AsymmetricCipherKeyPair GetKeyPair(AsymmetricAlgorithm privateKey)
 {
     //IL_0009: Unknown result type (might be due to invalid IL or missing references)
     //IL_0013: Expected O, but got Unknown
     //IL_001d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0027: Expected O, but got Unknown
     //IL_0032: Unknown result type (might be due to invalid IL or missing references)
     if (privateKey is DSA)
     {
         return(DotNetUtilities.GetDsaKeyPair((DSA)privateKey));
     }
     if (privateKey is RSA)
     {
         return(DotNetUtilities.GetRsaKeyPair((RSA)privateKey));
     }
     throw new ArgumentException("Unsupported algorithm specified", "privateKey");
 }
Ejemplo n.º 2
0
 public static RSA ToRSA(RsaKeyParameters rsaKey)
 {
     return(DotNetUtilities.CreateRSAProvider(DotNetUtilities.ToRSAParameters(rsaKey)));
 }
Ejemplo n.º 3
0
 public static RsaKeyParameters GetRsaPublicKey(RSA rsa)
 {
     return(DotNetUtilities.GetRsaPublicKey(rsa.ExportParameters(false)));
 }
Ejemplo n.º 4
0
 public static AsymmetricCipherKeyPair GetRsaKeyPair(RSA rsa)
 {
     return(DotNetUtilities.GetRsaKeyPair(rsa.ExportParameters(true)));
 }
Ejemplo n.º 5
0
 public static DsaPublicKeyParameters GetDsaPublicKey(DSA dsa)
 {
     return(DotNetUtilities.GetDsaPublicKey(dsa.ExportParameters(false)));
 }
Ejemplo n.º 6
0
 public static RSA ToRSA(RsaPrivateKeyStructure privKey)
 {
     return(DotNetUtilities.CreateRSAProvider(DotNetUtilities.ToRSAParameters(privKey)));
 }