Skip to main content

Secp256r1PrivateKeyProtocol

Secp256r1PrivateKeyProtocol Objects

class Secp256r1PrivateKeyProtocol(typing.Protocol)

public_key

def public_key() -> Secp256r1PublicKey

Get the public key corresponding to this private key.

sign_personal_message

def sign_personal_message(message: PersonalMessage) -> UserSignature

Sign a personal message and return a UserSignature.

sign_transaction

def sign_transaction(transaction: Transaction) -> UserSignature

Sign a transaction and return a UserSignature.

to_bech32

def to_bech32() -> str

Encode this private key as flag || privkey in Bech32 starting with "iotaprivkey" to a string.

to_bytes

def to_bytes() -> bytes

Serialize this private key to bytes.

to_der

def to_der() -> bytes

Serialize this private key as DER-encoded PKCS#8

to_pem

def to_pem() -> str

Serialize this private key as PEM-encoded PKCS#8

try_sign

def try_sign(message: bytes) -> Secp256r1Signature

Sign a message and return a Secp256r1Signature.

try_sign_simple

def try_sign_simple(message: bytes) -> SimpleSignature

Sign a message and return a SimpleSignature.

try_sign_user

def try_sign_user(message: bytes) -> UserSignature

Sign a message and return a UserSignature.