Ejemplo n.º 1
0
        public static PublicKey Decode(IByteReader stream)
        {
            PublicKey decodedPublicKey = new PublicKey();

            decodedPublicKey.Discriminant = PublicKeyType.Decode(stream);
            switch (decodedPublicKey.Discriminant.InnerValue)
            {
            case PublicKeyType.PublicKeyTypeEnum.PUBLIC_KEY_TYPE_ED25519:
                decodedPublicKey.Ed25519 = Uint256.Decode(stream);
                break;
            }
            return(decodedPublicKey);
        }
Ejemplo n.º 2
0
        public static PublicKey Decode(XdrDataInputStream stream)
        {
            var decodedPublicKey = new PublicKey();
            var discriminant     = PublicKeyType.Decode(stream);

            decodedPublicKey.Discriminant = discriminant;
            switch (decodedPublicKey.Discriminant.InnerValue)
            {
            case PublicKeyType.PublicKeyTypeEnum.PUBLIC_KEY_TYPE_ED25519:
                decodedPublicKey.Ed25519 = Uint256.Decode(stream);
                break;
            }
            return(decodedPublicKey);
        }