Skip to main content

Ed25519PrivateKey

Ed25519PrivateKey Objects

class Ed25519PrivateKey(Ed25519PrivateKeyProtocol)

from_bech32

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

Decode a private key from flag || privkey in Bech32 starting with "iotaprivkey".

from_der

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

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

from_mnemonic

@classmethod
def from_mnemonic(cls,
phrase: str,
account_index: int = 0,
password: str = "") -> Ed25519PrivateKey

Construct the private key from a mnemonic phrase

from_mnemonic_with_path

@classmethod
def from_mnemonic_with_path(cls,
phrase: str,
path: str,
password: str = "") -> Ed25519PrivateKey

Create an instance from a mnemonic phrase and a derivation path like "m/44'/4218'/0'/0'/0'"

from_pem

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

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 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