Beispiel #1
0
        public static AsnPrivateKeyInfo Decode(byte[] source, ref int pos)
        {
            AsnPrivateKeyInfo instance = new AsnPrivateKeyInfo();

            //CheckContextTag(source, ref pos);
            pos++;

            int len = instance.GetLength(source, ref pos);

            instance.algorithm = AsnAlgorithmIdentifier.Decode(source, ref pos);
            instance.publicKey = AsnBitstring.Decode(source, ref pos);

            // TODO: further decode publicKey into AsnKeyPair
            int bi = 0;

            instance.keys = AsnPrivateKeyPair.Decode(instance.publicKey.value, ref bi);

            return(instance);
        }