{"record":{"id":"e5b89946f0b4de07","repo":"BerriAI/litellm","slug":"the-provided-private-key-is-not-an-rsa-key-which","errorCode":null,"errorMessage":"The provided private key is not an RSA key, which is required for OCI signing.","messagePattern":"The provided private key is not an RSA key, which is required for OCI signing\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oci/common_utils.py","lineNumber":123,"sourceCode":"def build_signature_string(method: str, path: str, headers: dict, signed_headers: list) -> str:\n    lines: Final = []\n    for header in signed_headers:\n        if header == \"(request-target)\":\n            value = f\"{method.lower()} {path}\"\n        else:\n            value = headers[header]\n        lines.append(f\"{header}: {value}\")\n    return \"\\n\".join(lines)\n\n\ndef load_private_key_from_str(key_str: str) -> Any:\n    _require_cryptography()\n    key: Final = serialization.load_pem_private_key(\n        key_str.encode(\"utf-8\"),\n        password=None,\n    )\n    if not isinstance(key, rsa.RSAPrivateKey):\n        raise TypeError(\"The provided private key is not an RSA key, which is required for OCI signing.\")\n    return key\n\n\ndef load_private_key_from_file(file_path: str) -> Any:\n    \"\"\"Loads a private key from a file path.\"\"\"\n    try:\n        with open(file_path, \"r\", encoding=\"utf-8\") as f:\n            key_str: Final = f.read().strip()\n    except FileNotFoundError:\n        raise FileNotFoundError(f\"Private key file not found: {file_path}\")\n    except OSError as e:\n        raise OSError(f\"Failed to read private key file '{file_path}': {e}\") from e\n\n    if not key_str:\n        raise ValueError(f\"Private key file is empty: {file_path}\")\n\n    return load_private_key_from_str(key_str)\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/common_utils.py#L105-L141","documentation":"Error \"The provided private key is not an RSA key, which is required for OCI signing.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/common_utils.py:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an RSA private key for OCI signing; generate one with: openssl genrsa -out oci_key.pem 2048."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}