The bytes (a view; do not mutate).
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticrandomA fresh random value; pass rng to make it deterministic.
StaticfromCreate a PrivateKeyBase from raw bytes.
32 bytes of key material
Derive an Ed25519 signing private key.
Uses HKDF with salt "signing", as the reference implementation does's derive_signing_private_key().
Derive an X25519 agreement private key.
Uses HKDF with salt "agreement", as the reference implementation does's derive_agreement_private_key().
Get EncapsulationPrivateKey for decryption.
Returns the derived X25519 private key wrapped as EncapsulationPrivateKey.
Decapsulate a shared secret from a ciphertext.
Implements the Decrypter interface so a PrivateKeyBase can be used
directly as a recipient key,.
Derive a PrivateKeys container with Ed25519 signing and X25519 agreement keys.
PrivateKeys containing the derived signing and encapsulation keys
Derive a PublicKeys container from the derived keys.
PublicKeys containing the derived public keys
Derive a Schnorr signing private key.
Uses ECPrivateKey.deriveFromKeyMaterial() as the reference implementation does's PrivateKeyBase::schnorr_signing_private_key().
Derive a PrivateKeys container with Schnorr signing and X25519 agreement keys.
Derive a PublicKeys container from Schnorr derived keys.
Derive an ECDSA signing private key.
Uses ECPrivateKey.deriveFromKeyMaterial() as the reference implementation does's PrivateKeyBase::ecdsa_signing_private_key().
Derive a PrivateKeys container with ECDSA signing and X25519 agreement keys.
Derive a PublicKeys container from ECDSA derived keys.
Derive an SSH SigningPrivateKey from this PrivateKeyBase.
Builds an HKDFRng seeded by this._data with salt
sshAlgorithmName(algorithm) (the wire name, as the reference's
HKDFRng::new(seed, algorithm.as_str())), then dispatches to the
matching ssh-key 0.6.7 *Keypair::random constructor, ported so the
RNG is consumed identically and the key is byte-for-byte the reference's:
ssh-ed25519): Ed25519Keypair::random — 32 seed bytes.ssh-dss): DsaKeypair::random — the dsa crate's
FIPS 186-4 1024/160 parameter search (generateDsaKeypair).ssh-rsa): RsaKeypair::random(rng, 2048) — the rsa
crate's two-prime generation with e = 65537 (generateRsaKeypair).p{256,384,521}::SecretKey::random
rejection sampling over the field-sized byte string.algorithm is validated before any bytes are drawn: an unknown kind or
curve is InvalidData.
The SSH key algorithm to derive
Optional comment carried through the OpenSSH PEM
Derive a PrivateKeys container with an SSH signing key and an X25519
agreement key.
Derive a PublicKeys container from sshPrivateKeys. Mirrors the reference's
PrivateKeyBase::ssh_public_keys
The reference: the digest of the tagged CBOR, as the reference computes it.
The first four bytes of reference() in hex, the reference's ref_hex_short.
The reference's Display: the type name over the short reference.
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding.
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
PrivateKeyBase - Root cryptographic material for deterministic key derivation.
This is the foundation from which signing keys and agreement keys can be deterministically derived using HKDF.