Skip to main content

Secp256r1PrivateKeyInterface

type Secp256r1PrivateKeyInterface

type Secp256r1PrivateKeyInterface interface {
// Get the public key corresponding to this private key.
PublicKey() *Secp256r1PublicKey
Scheme() SignatureScheme
// Sign a personal message and return a UserSignature.
SignPersonalMessage(message *PersonalMessage) (*UserSignature, error)
// Sign a transaction and return a UserSignature.
SignTransaction(transaction *Transaction) (*UserSignature, error)
// Encode this private key as `flag || privkey` in Bech32 starting with
// "iotaprivkey" to a string.
ToBech32() (string, error)
// Serialize this private key to bytes.
ToBytes() []byte
// Serialize this private key as DER-encoded PKCS#8
ToDer() ([]byte, error)
// Serialize this private key as PEM-encoded PKCS#8
ToPem() (string, error)
// Sign a message and return a Secp256r1Signature.
TrySign(message []byte) (*Secp256r1Signature, error)
// Sign a message and return a SimpleSignature.
TrySignSimple(message []byte) (*SimpleSignature, error)
// Sign a message and return a UserSignature.
TrySignUser(message []byte) (*UserSignature, error)
VerifyingKey() *Secp256r1VerifyingKey
}