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); } }
public CfdKeyData(ExtPrivkey extPrivkey) { KeyType = CfdDescriptorKeyType.Bip32Priv; Pubkey = new Pubkey(); ExtPubkey = new ExtPubkey(); ExtPrivkey = extPrivkey; }
public CfdKeyData(Pubkey pubkey) { KeyType = CfdDescriptorKeyType.Public; Pubkey = pubkey; ExtPubkey = new ExtPubkey(); ExtPrivkey = new ExtPrivkey(); }
public CfdKeyData(SchnorrPubkey schnorrPubkey) { KeyType = CfdDescriptorKeyType.SchnorrPubkey; Pubkey = new Pubkey(); ExtPubkey = new ExtPubkey(); ExtPrivkey = new ExtPrivkey(); SchnorrPubkey = schnorrPubkey; }
public CfdKeyData(ExtPubkey extPubkey) { KeyType = CfdDescriptorKeyType.Bip32; Pubkey = new Pubkey(); ExtPubkey = extPubkey; ExtPrivkey = new ExtPrivkey(); SchnorrPubkey = new SchnorrPubkey(); }
public CfdKeyData(CfdDescriptorKeyType keyType, Pubkey pubkey, ExtPubkey extPubkey, ExtPrivkey extPrivkey) { KeyType = keyType; Pubkey = pubkey; ExtPubkey = extPubkey; ExtPrivkey = extPrivkey; }
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()); } }