コード例 #1
0
ファイル: OpenSslX509Encoder.cs プロジェクト: noahfalk/corefx
        private static RSA BuildRsaPublicKey(byte[] encodedData)
        {
            using (SafeRsaHandle rsaHandle = Interop.Crypto.DecodeRsaPublicKey(encodedData, encodedData.Length))
            {
                Interop.Crypto.CheckValidOpenSslHandle(rsaHandle);

                RSAParameters rsaParameters = Interop.Crypto.ExportRsaParameters(rsaHandle, false);
                RSA rsa = new RSAOpenSsl();
                rsa.ImportParameters(rsaParameters);
                return rsa;
            }
        }
コード例 #2
0
        private static unsafe RSA BuildRsaPublicKey(byte[] encodedData)
        {
            using (SafeRsaHandle rsaHandle = Interop.libcrypto.OpenSslD2I(Interop.libcrypto.d2i_RSAPublicKey, encodedData))
            {
                Interop.libcrypto.CheckValidOpenSslHandle(rsaHandle);

                RSAParameters rsaParameters = Interop.libcrypto.ExportRsaParameters(rsaHandle, false);
                RSA rsa = new RSAOpenSsl();
                rsa.ImportParameters(rsaParameters);
                return rsa;
            }
        }
コード例 #3
0
 public RSACryptoServiceProvider()
 {
     _defer = new RSAOpenSsl();
 }
コード例 #4
0
 public RSACryptoServiceProvider(int dwKeySize)
 {
     _defer = new RSAOpenSsl(dwKeySize);
 }
コード例 #5
0
 public RSACryptoServiceProvider(int dwKeySize)
 {
     _defer = new RSAOpenSsl(dwKeySize);
     _legalKeySizesValue = _defer.LegalKeySizes;
 }