Exemplo n.º 1
0
            public PayToPubKey(BlockChainIdentity intendedBlockChain, byte[] pubKey, SignatureAlgorithm.Kinds dsa)
                : base(intendedBlockChain)
            {
                if (pubKey == null)
                {
                    throw new ArgumentNullException(nameof(pubKey));
                }
                // TODO: Validate pubkey length, this could change based on the DSA
                // These validation funcs should go in Signature class.

                PubKey = pubKey;
                Dsa    = dsa;
            }
Exemplo n.º 2
0
            private static byte[] BuildScript(byte[] pubKey, SignatureAlgorithm.Kinds dsa)
            {
                if (pubKey == null)
                {
                    throw new ArgumentNullException(nameof(pubKey));
                }

                switch (dsa)
                {
                case SignatureAlgorithm.Kinds.Secp256k1:
                    throw new NotImplementedException();

                case SignatureAlgorithm.Kinds.Ed25519:
                    throw new NotImplementedException();

                case SignatureAlgorithm.Kinds.SecSchnorr:
                    throw new NotImplementedException();

                default:
                    throw new NotImplementedException($"Unknown conversion for {nameof(SignatureAlgorithm.Kinds)} value `{dsa}`");
                }
            }
Exemplo n.º 3
0
 public PubKey(byte[] pubKey, SignatureAlgorithm.Kinds dsa) : base(BuildScript(pubKey, dsa))
 {
     PubKeyBytes = pubKey;
     Dsa         = dsa;
 }