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

    Class SSHPublicKey

    SSH key/signature/certificate types — Ed25519, DSA, RSA and ECDSA P-256 / P-384 / P-521 over the OpenSSH text and binary formats.

    Index

    The parsed key material by algorithm.

    comment: string

    The comment field of the OpenSSH text form (may be empty).

    • get keyBytes(): Uint8Array

      Algorithm-specific raw payload bytes. Throws for DSA and RSA, whose keys are several integers — use data.p/q/g/y or data.e/n instead.

      Returns Uint8Array

    • A P-256 key from its 65-byte SEC1 uncompressed point.

      Parameters

      • uncompressedPoint: Uint8Array
      • comment: string = ""

      Returns SSHPublicKey

    • A P-384 key from its 97-byte SEC1 uncompressed point.

      Parameters

      • uncompressedPoint: Uint8Array
      • comment: string = ""

      Returns SSHPublicKey

    • A P-521 key from its 133-byte SEC1 uncompressed point.

      Parameters

      • uncompressedPoint: Uint8Array
      • comment: string = ""

      Returns SSHPublicKey

    • DSA public key. p/q/g/y must already be canonical positive bytes (no sign byte).

      Parameters

      • p: Uint8Array
      • q: Uint8Array
      • g: Uint8Array
      • y: Uint8Array
      • comment: string = ""

      Returns SSHPublicKey

    • RSA public key. e and n must already be canonical positive bytes (no sign byte).

      Parameters

      • e: Uint8Array
      • n: Uint8Array
      • comment: string = ""

      Returns SSHPublicKey

    • Parses the single-line OpenSSH text form (<algorithm> <base64 blob> [comment]) as ssh-key 0.6.7 PublicKey::from_openssh: trailing whitespace is removed, the algorithm and Base64 segments end at a single space, the Base64 is strict, and the text's algorithm name must equal the blob's (unknown algorithm otherwise).

      Parameters

      • text: string

      Returns SSHPublicKey

    • The binary key blob, byte for byte as OpenSSH writes it.

      Returns Uint8Array

    • SHA-256 of the OpenSSH text form (the reference's Reference image).

      Returns Uint8Array

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

      Returns string

    • SSHPublicKey(<short reference>), the reference's Display.

      Returns string

    • Comment-insensitive equality: matches when algorithm and key data agree, ignoring the comment. Used by verify paths since SSH wire-format pubkey blobs carry the key but not the comment.

      Parameters

      Returns boolean

    • Verifies an sshsig signature made over message in namespace, as ssh_key::PublicKey::verify: the embedded key must be this key, the namespace must match, and the algorithm-specific signature must verify over the signed-data blob. Never throws on malformed input.

      Parameters

      Returns boolean