Beispiel #1
0
        public void DecodePublicKey(byte[] data)
        {
            if (data == null)
            {
                throw new Exception("ArgumentNull - data");
            }

            var asnDecoder = new Asn1BerDecodeBuffer(data);
            var publicKey  = new GostR34102001PublicKey();

            publicKey.Decode(asnDecoder);

            PublicKey = publicKey.Value;
        }
        public void DecodePublicKey(byte[] data)
        {
            if (data == null)
            {
                throw ExceptionUtility.ArgumentNull("data");
            }

            try
            {
                var asnDecoder = new Asn1BerDecodeBuffer(data);
                var publicKey  = new GostR34102001PublicKey();
                publicKey.Decode(asnDecoder);

                PublicKey = publicKey.Value;
            }
            catch (Exception exception)
            {
                throw ExceptionUtility.CryptographicException(exception, Resources.Asn1DecodeError, typeof(GostR34102001PublicKey).FullName);
            }
        }