Secp256k1PrivateKey
Secp256k1PrivateKey Objects
class Secp256k1PrivateKey(Secp256k1PrivateKeyProtocol)
from_bech32
@classmethod
def from_bech32(cls, value: str) -> Secp256k1PrivateKey
Decode a private key from flag || privkey in Bech32 starting with
"iotaprivkey".
from_der
@classmethod
def from_der(cls, bytes: bytes) -> Secp256k1PrivateKey
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 = "") -> Secp256k1PrivateKey
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 = "") -> Secp256k1PrivateKey
Create an instance from a mnemonic phrase and a derivation path like
"m/54'/4218'/0'/0/0"
from_pem
@classmethod
def from_pem(cls, s: str) -> Secp256k1PrivateKey
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