Beispiel #1
0
 public bool Equals(CfdKeyData other)
 {
     if (KeyType != other.KeyType)
     {
         return(false);
     }
     else if (KeyType == CfdDescriptorKeyType.Bip32)
     {
         return(ExtPubkey.Equals(other.ExtPubkey));
     }
     else if (KeyType == CfdDescriptorKeyType.Bip32Priv)
     {
         return(ExtPrivkey.Equals(other.ExtPrivkey));
     }
     else if (KeyType == CfdDescriptorKeyType.Public)
     {
         return(Pubkey.Equals(other.Pubkey));
     }
     else if (KeyType == CfdDescriptorKeyType.SchnorrPubkey)
     {
         return(SchnorrPubkey.Equals(other.SchnorrPubkey));
     }
     else
     {
         return(false);
     }
 }
Beispiel #2
0
 public CfdKeyData(ExtPrivkey extPrivkey)
 {
     KeyType    = CfdDescriptorKeyType.Bip32Priv;
     Pubkey     = new Pubkey();
     ExtPubkey  = new ExtPubkey();
     ExtPrivkey = extPrivkey;
 }
Beispiel #3
0
 public CfdKeyData(Pubkey pubkey)
 {
     KeyType    = CfdDescriptorKeyType.Public;
     Pubkey     = pubkey;
     ExtPubkey  = new ExtPubkey();
     ExtPrivkey = new ExtPrivkey();
 }
Beispiel #4
0
 public CfdKeyData(SchnorrPubkey schnorrPubkey)
 {
     KeyType       = CfdDescriptorKeyType.SchnorrPubkey;
     Pubkey        = new Pubkey();
     ExtPubkey     = new ExtPubkey();
     ExtPrivkey    = new ExtPrivkey();
     SchnorrPubkey = schnorrPubkey;
 }
Beispiel #5
0
 public CfdKeyData(ExtPubkey extPubkey)
 {
     KeyType       = CfdDescriptorKeyType.Bip32;
     Pubkey        = new Pubkey();
     ExtPubkey     = extPubkey;
     ExtPrivkey    = new ExtPrivkey();
     SchnorrPubkey = new SchnorrPubkey();
 }
Beispiel #6
0
 public CfdKeyData(CfdDescriptorKeyType keyType, Pubkey pubkey,
                   ExtPubkey extPubkey, ExtPrivkey extPrivkey)
 {
     KeyType    = keyType;
     Pubkey     = pubkey;
     ExtPubkey  = extPubkey;
     ExtPrivkey = extPrivkey;
 }
Beispiel #7
0
 public override int GetHashCode()
 {
     if (KeyType == CfdDescriptorKeyType.Bip32)
     {
         return(KeyType.GetHashCode() + ExtPubkey.GetHashCode());
     }
     else if (KeyType == CfdDescriptorKeyType.Bip32Priv)
     {
         return(KeyType.GetHashCode() + ExtPrivkey.GetHashCode());
     }
     else if (KeyType == CfdDescriptorKeyType.Public)
     {
         return(KeyType.GetHashCode() + Pubkey.GetHashCode());
     }
     else
     {
         return(KeyType.GetHashCode());
     }
 }