pub enum SignerKey {
Ed25519(PublicKey),
PreAuthTx(PreAuthTxHash),
HashX(HashX),
Ed25519SignedPayload(SignerKeyEd25519SignedPayload),
}Expand description
A transaction signer key.
Variants§
Ed25519(PublicKey)
PreAuthTx(PreAuthTxHash)
HashX(HashX)
Ed25519SignedPayload(SignerKeyEd25519SignedPayload)
Implementations§
Source§impl SignerKey
impl SignerKey
Sourcepub fn new_from_public_key(key: PublicKey) -> SignerKey
pub fn new_from_public_key(key: PublicKey) -> SignerKey
Creates a SignerKey with ed25519 key.
Sourcepub fn new_from_hashx(hashx: HashX) -> SignerKey
pub fn new_from_hashx(hashx: HashX) -> SignerKey
Creates a SignerKey with hash(x) key.
Sourcepub fn new_with_hashx(preimage: &[u8]) -> SignerKey
pub fn new_with_hashx(preimage: &[u8]) -> SignerKey
Creates a SignerKey with the hash of the preimage as key.
Creates a SignerKey from the pre authorized transaction hash.
Sourcepub fn new_from_transaction_envelope(
tx: &TransactionEnvelope,
network: &Network,
) -> Result<SignerKey>
pub fn new_from_transaction_envelope( tx: &TransactionEnvelope, network: &Network, ) -> Result<SignerKey>
Creates a SignerKey from the transaction envelope as pre authorized transaction.
Sourcepub fn as_ed25519(&self) -> Option<&PublicKey>
pub fn as_ed25519(&self) -> Option<&PublicKey>
If the signer is a Ed25519 key, returns its value. Returns None otherwise.
Sourcepub fn as_ed25519_mut(&mut self) -> Option<&mut PublicKey>
pub fn as_ed25519_mut(&mut self) -> Option<&mut PublicKey>
If the signer is a Ed25519 key, returns its mutable value. Returns None otherwise.
Sourcepub fn is_ed25519(&self) -> bool
pub fn is_ed25519(&self) -> bool
Returns true if the signer is a Ed25519 key.
If the signer is a PreAuthTx, returns its value. Returns None otherwise.
If the signer is a PreAuthTx, returns its mutable value. Returns None otherwise.
Returns true if the signer is a PreAuthTx.
Sourcepub fn as_hashx(&self) -> Option<&HashX>
pub fn as_hashx(&self) -> Option<&HashX>
If the signer is a HashX, returns its value. Returns None otherwise.
Sourcepub fn as_hashx_mut(&mut self) -> Option<&mut HashX>
pub fn as_hashx_mut(&mut self) -> Option<&mut HashX>
If the signer is a HashX, returns its mutable value. Returns None otherwise.