Exemple #1
0
        public RSACrypto(byte[] key)
        {
            AsnKeyParser keyParser = new AsnKeyParser(key);

            rsa = new RSACryptoServiceProvider();
            rsa.ImportParameters(keyParser.ParseRSAPublicKey());
        }
Exemple #2
0
        public RSACrypto( byte[] key )
        {
            AsnKeyParser keyParser = new AsnKeyParser( key );

            rsa = new RSACryptoServiceProvider();
            rsa.ImportParameters( keyParser.ParseRSAPublicKey() );
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SteamKit2.RSACrypto"/> class.
        /// </summary>
        /// <param name="key">The public key to encrypt with.</param>
        public RSACrypto(byte[] key)
        {
            AsnKeyParser keyParser = new AsnKeyParser(key);

            rsa = RSA.Create();
            rsa.ImportParameters(keyParser.ParseRSAPublicKey());
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SteamKit2.RSACrypto"/> class.
        /// </summary>
        /// <param name="key">The public key to encrypt with.</param>
        public RSACrypto(byte[] key)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            AsnKeyParser keyParser = new AsnKeyParser(key);

            rsa = RSA.Create();
            rsa.ImportParameters(keyParser.ParseRSAPublicKey());
        }