コード例 #1
0
        //
        // Summary:
        //  Given a pointer to a CryptoHandle create a new instance of this class.
        //
        public InfoCardRSACryptoProvider(AsymmetricCryptoHandle cryptoHandle)
            : base()
        {
            m_cryptoHandle = (AsymmetricCryptoHandle)cryptoHandle.Duplicate();

            try
            {
                m_params = (RpcAsymmetricCryptoParameters)m_cryptoHandle.Parameters;

                int keySize = m_params.keySize;

                LegalKeySizesValue    = new KeySizes[1];
                KeySizeValue          = keySize;
                LegalKeySizesValue[0] = new KeySizes(keySize, keySize, 0);
            }
            catch
            {
                m_cryptoHandle.Dispose();
                m_cryptoHandle = null;
                throw;
            }
        }
コード例 #2
0
        //
        // Summary:
        //  Given a pointer to a CryptoHandle create a new instance of this class.
        //
        public InfoCardRSACryptoProvider(AsymmetricCryptoHandle cryptoHandle)
            : base()
        {
            m_cryptoHandle = (AsymmetricCryptoHandle)cryptoHandle.Duplicate();

            try
            {
                m_params = (RpcAsymmetricCryptoParameters)m_cryptoHandle.Parameters;

                int keySize = m_params.keySize;

                LegalKeySizesValue = new KeySizes[1];
                KeySizeValue = keySize;
                LegalKeySizesValue[0] = new KeySizes(keySize, keySize, 0);
            }
            catch
            {
                m_cryptoHandle.Dispose();
                m_cryptoHandle = null;
                throw;
            }
        }
コード例 #3
0
 protected override void Dispose(bool disposing)
 {
     m_cryptoHandle.Dispose();
 }