Skip to main content

SimpleKeypair

SimpleKeypair Objects

class SimpleKeypair(SimpleKeypairProtocol)

from_bech32

@classmethod
def from_bech32(cls, value: str) -> SimpleKeypair

Decode a SimpleKeypair from flag || privkey in Bech32 starting with "iotaprivkey" to SimpleKeypair. The public key is computed directly from the private key bytes.

from_bytes

@classmethod
def from_bytes(cls, bytes: bytes) -> SimpleKeypair

Decode a SimpleKeypair from flag || privkey bytes

from_der

@classmethod
def from_der(cls, bytes: bytes) -> SimpleKeypair

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).

from_pem

@classmethod
def from_pem(cls, s: str) -> SimpleKeypair

Deserialize PKCS#8-encoded private key from PEM.

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 a SimpleKeypair as flag || privkey in Bech32 starting with "iotaprivkey" to a string. Note that the pubkey is not encoded.

to_bytes

def to_bytes() -> bytes

Encode a SimpleKeypair as flag || privkey in 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 DER-encoded PKCS#8