{"success":true,"data":{"ext":"csr","name":"CSR","description":"Certificate Signing Request (CSR) is a data format defined by the PKCS #10 standard and maintained within the IETF X.509 certificate ecosystem. It is used to request digital certificates from certificate authorities, typically for websites, email, code signing, and other public key infrastructure deployments. CSRs are generally safe to handle, but they contain identifying information and a public key, so verification of the requester remains important.","mime":[],"risk_level":"Safe","signatures":[{"hex":"2D 2D 2D 2D 2D 42 45 47 49 4E 20 43 45 52 54 49 46 49 43 41 54 45 20 52 45 51 55 45 53 54 2D 2D 2D 2D 2D","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["asc","key","pem","crt","der","gpg"],"usage":{"python":"def is_csr(file_path: str) -> bool:\n    \"\"\"Check if file is a valid CSR by magic bytes.\"\"\"\n    signature = bytes([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x20, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D])\n    with open(file_path, \"rb\") as f:\n        return f.read(35) == signature","node":"function isCSR(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x20, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D]);\n  return buffer.subarray(0, 35).equals(signature);\n}","go":"func IsCSR(data []byte) bool {\n    signature := []byte{0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x20, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D}\n    if len(data) < 35 {\n        return false\n    }\n    return bytes.Equal(data[:35], signature)\n}"},"category":"Certificates & Keys"}}