{"success":true,"data":{"ext":"pub","name":"SSH2 public key (RFC 4716)","description":"SSH2 public key (RFC 4716) is a text-based public key file format defined by the IETF for exchanging SSH public keys. It is used to distribute and import public keys for SSH authentication, account setup, and key management across clients and servers. The format contains only public key material and is generally safe to share, though it is a legacy interchange format that has been largely superseded by OpenSSH key conventions.","mime":[],"risk_level":"Safe","signatures":[{"hex":"2D 2D 2D 2D 2D 42 45 47 49 4E 20 53 53 48 32 20 4B 45 59 2D 2D 2D 2D 2D","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"D0 CF 11 E0 A1 B1 1A E1","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"FD FF FF FF 02","offset":512,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["key","asc","csr","p7s","pem"],"usage":{"python":"def is_pub(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PUB by magic bytes.\"\"\"\n    signature = bytes([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x53, 0x53, 0x48, 0x32, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D])\n    with open(file_path, \"rb\") as f:\n        return f.read(24) == signature","node":"function isPUB(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x53, 0x53, 0x48, 0x32, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D]);\n  return buffer.subarray(0, 24).equals(signature);\n}","go":"func IsPUB(data []byte) bool {\n    signature := []byte{0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x53, 0x53, 0x48, 0x32, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D}\n    if len(data) < 24 {\n        return false\n    }\n    return bytes.Equal(data[:24], signature)\n}"},"category":"Certificates & Keys"}}