Ejemplo n.º 1
0
        public byte[] ToBytes()
        {
            RsaPrivateKeyStructure keyStruct = new RsaPrivateKeyStructure(
                _Key.Modulus,
                _Key.PublicExponent,
                _Key.Exponent,
                _Key.P,
                _Key.Q,
                _Key.DP,
                _Key.DQ,
                _Key.QInv);

            var privInfo = new PrivateKeyInfo(algID, keyStruct.ToAsn1Object());

            return(privInfo.ToAsn1Object().GetEncoded());
        }