{"success":true,"data":{"ext":"key","name":"KEY","description":"KEY is a PEM-encoded private key file format derived from the Public-Key Cryptography Standards (PKCS), originally developed by RSA Laboratories and commonly used by OpenSSL and related tools. It is used to store cryptographic private keys for SSL/TLS certificates, server authentication, code signing, and other applications that require secure key material. Because it may contain sensitive credentials, access should be restricted; some KEY files are legacy encodings or may be unencrypted despite the format's age.","mime":["application/x-pem-file"],"risk_level":"Safe","signatures":[{"hex":"2D 2D 2D 2D 2D 42 45 47 49 4E 20 50 52 49 56 41 54 45 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":"2D 2D 2D 2D 2D 42 45 47 49 4E 20 44 53 41 20 50 52 49 56 41 54 45 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":"2D 2D 2D 2D 2D 42 45 47 49 4E 20 52 53 41 20 50 52 49 56 41 54 45 20 4B 45 59 2D 2D 2D 2D 2D","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["asc","pem","csr","crt","der","gpg"],"usage":{"python":"def is_key(file_path: str) -> bool:\n    \"\"\"Check if file is a valid KEY by magic bytes.\"\"\"\n    signature = bytes([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D])\n    with open(file_path, \"rb\") as f:\n        return f.read(27) == signature","node":"function isKEY(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D]);\n  return buffer.subarray(0, 27).equals(signature);\n}","go":"func IsKEY(data []byte) bool {\n    signature := []byte{0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4B, 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D}\n    if len(data) < 27 {\n        return false\n    }\n    return bytes.Equal(data[:27], signature)\n}"},"category":"Certificates & Keys"}}