# ocx_sdk

*module*

Python SDK for [OCX](https://github.com/ocx-sh/ocx).

`ocx-sdk` drives the ocx binary rather than reimplementing it: ocx owns
resolution, verification, and the identifier grammar, and this package gives
you typed, CWD-independent handles over the commands it exposes.

```python
from ocx_sdk import Ocx, bootstrap

ocx = Ocx(exe=bootstrap.ensure())
project = ocx.project("/srv/build")
project.pull()
project.exec(["task", "verify"])
```

**This module is the API.** Everything listed in `__all__` is the stable
surface; every other module is underscored and package-private, and the one
public submodule is `ocx_sdk.bootstrap`. Reaching into an underscored path
means the next release may move it without notice — pre-1.0, breaking
changes ship without shims.

Start at `Ocx` for the runtime API and `bootstrap.ensure` for provisioning.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/__init__.py#L1-L1)

## ocx_sdk.SbomEntry

*class* · *dataclass*

```python
class SbomEntry
```

Re-exported from: `ocx_sdk._results`

One SBOM document `sbom` listed (C-014).

Field list verified against `sbom.rs:104-162`.

**Attributes**

- `predicate_type` (`str`) — The SBOM's predicate type URI (CycloneDX, SPDX, ...).
- `verified` (`bool`) — Whether a signature was verified over this document. `False` means it is attached raw, with no identity behind it — this is ocx policy, not a cosign or CycloneDX term.
- `shadowed` (`bool`) — Whether a platform-level SBOM of the *same* `predicate_type` supersedes this index-level one. Always present; `False` is a true claim, not an absence.
- `subject_digest` (`str`) — The manifest digest this SBOM describes.
- `referrer_digest` (`str`) — This SBOM document's own digest. **Not always a manifest digest** — for a verified `.att` sidecar it is a layer blob digest (`sbom.rs:128-148`); feeding it to a manifest fetch 404s. Same caveat `SignatureEntry`/`VerificationReport` carry for their own `referrer_digest`.
- `certificate_identity` (`str | None`) — The Fulcio certificate's identity, when `verified` and the signature is keyless.
- `certificate_oidc_issuer` (`str | None`) — The Fulcio certificate's OIDC issuer, when `verified` and the signature is keyless.
- `signed_at` (`str | None`) — When the signature was produced, as ocx spelled it, when `verified`.
- `summary` (`SbomSummaryOut | None`) — Component counts, when the call carried `--summary` and this entry parsed successfully as CycloneDX 1.5-1.7 — see `SbomSummaryOut`. `None` otherwise; the listing itself still works without `--summary`, it just leaves this unpopulated.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2057-L2114)

### ocx_sdk.SbomEntry.certificate_identity

*attribute* · *class attribute* · *instance attribute*

```python
certificate_identity: str | None = None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2095-L2095)

### ocx_sdk.SbomEntry.certificate_oidc_issuer

*attribute* · *class attribute* · *instance attribute*

```python
certificate_oidc_issuer: str | None = None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2096-L2096)

### ocx_sdk.SbomEntry.predicate_type

*attribute* · *instance attribute*

```python
predicate_type: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2090-L2090)

### ocx_sdk.SbomEntry.referrer_digest

*attribute* · *instance attribute*

```python
referrer_digest: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2094-L2094)

### ocx_sdk.SbomEntry.shadowed

*attribute* · *instance attribute*

```python
shadowed: bool
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2092-L2092)

### ocx_sdk.SbomEntry.signed_at

*attribute* · *class attribute* · *instance attribute*

```python
signed_at: str | None = None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2097-L2097)

### ocx_sdk.SbomEntry.from_dict

*method* · *classmethod*

```python
def from_dict(data: Mapping[str, Any]) -> SbomEntry
```

Build from one decoded entry of `SbomListingReport.entries`.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2100-L2114)
