{"library":"sigstore-rekor-types","title":"Sigstore Rekor Types","description":"This package provides Python data models for the Sigstore Rekor API types. It primarily consists of Pydantic models generated from the Rekor OpenAPI specification, enabling programmatic interaction with Rekor's data structures. The library is currently at version 0.0.18 and receives updates as the upstream Rekor API evolves, maintaining an active release cadence.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install sigstore-rekor-types"],"cli":null},"imports":["from sigstore_rekor_types.models.rekord import Rekord","from sigstore_rekor_types.models.hashedrekord import HashedRekord","from sigstore_rekor_types.models.log_entry import LogEntry"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import datetime\nfrom sigstore_rekor_types.models.hashedrekord import HashedRekord, HashedRekordSchema\nfrom sigstore_rekor_types.models.log_entry import LogEntry\nfrom sigstore_rekor_types.models.rekord import RekordObj, RekordObjSchema, RekordObjSignature, RekordObjSignaturePublicKey, RekordObjSignatureData\n\n# Example of creating a HashedRekord object (a common Rekor v2 type)\n# Note: This library provides models, not client functionality to upload to Rekor.\n# For a full client, see sigstore-python.\n\ntry:\n    hashed_rekord_content = HashedRekordSchema(\n        apiVersion='0.0.1',\n        kind='hashedrekord',\n        spec=HashedRekord(\n            signature=RekordObjSignature(\n                content='base64encodedsignature==',\n                format='minisign',\n                publicKey=RekordObjSignaturePublicKey(\n                    content='base64encodedpublickey=='\n                )\n            ),\n            data=RekordObjData(\n                hash=RekordObjHash(\n                    algorithm='sha256',\n                    value='a' * 64 # Example SHA256 hash\n                )\n            )\n        )\n    )\n    print(\"HashedRekord object created successfully:\")\n    print(hashed_rekord_content.model_dump_json(indent=2))\n\n    # Example of a generic LogEntry structure, often returned by Rekor\n    example_log_entry = LogEntry(\n        apiVersion=\"1.0.0\",\n        kind=\"hashedrekord\",\n        spec=hashed_rekord_content.spec.model_dump(mode='json'), # embed the spec\n        uuid=\"some-unique-uuid\",\n        integratedTime=int(datetime.datetime.now(datetime.timezone.utc).timestamp()),\n        logID=\"some-log-id\",\n        logIndex=12345,\n        body=\"base64encodedlogentrybody==\",\n        verification=None\n    )\n    print(\"\\nExample LogEntry object (often retrieved from Rekor):\")\n    print(example_log_entry.model_dump_json(indent=2))\n\nexcept Exception as e:\n    print(f\"Error creating models: {e}\")","lang":"python","description":"This quickstart demonstrates how to instantiate core Pydantic models provided by `sigstore-rekor-types`, specifically `HashedRekord` which is a primary entry type in Rekor v2, and a generic `LogEntry` structure. This library focuses purely on data models, not client interaction with the Rekor API itself. For full client functionality (uploading, verifying), integrate with `sigstore-python`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}