@blockchaincommons/components - v1.0.0-beta.4
    Preparing search index...

    Class PrivateKeyBase

    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.

    Implements

    Index
    • Derive a PrivateKeys container with Ed25519 signing and X25519 agreement keys.

      Returns PrivateKeys

      PrivateKeys containing the derived signing and encapsulation 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:

      • Ed25519 (ssh-ed25519): Ed25519Keypair::random — 32 seed bytes.
      • DSA (ssh-dss): DsaKeypair::random — the dsa crate's FIPS 186-4 1024/160 parameter search (generateDsaKeypair).
      • RSA (ssh-rsa): RsaKeypair::random(rng, 2048) — the rsa crate's two-prime generation with e = 65537 (generateRsaKeypair).
      • ECDSA P-256 / P-384 / P-521: 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.

      Parameters

      • algorithm: SshAlgorithm

        The SSH key algorithm to derive

      • comment: string = ""

        Optional comment carried through the OpenSSH PEM

      Returns SigningPrivateKey

    • The first four bytes of reference() in hex, the reference's ref_hex_short.

      Returns string

    • The reference's Display: the type name over the short reference.

      Returns string

    • The CBOR tags this type decodes from; the first one is used to encode.

      Returns Tag[]

    • The tagged CBOR form.

      Returns Cbor

    • As a UR, typed by the first tag's name.

      Returns UR