Overview
Certificates play a critical role in the API’s security model:- Digital Signatures - Sign measurement specifications and results
- Verification - Verify the authenticity of signed messages
- Trust Chain - Establish trust between MeasurementConsumers and DataProviders
All certificates returned by API resources are never root certificates. They must be verified using a certificate that has been exchanged outside of the API through a secure channel.
Certificate Resource
Certificates are represented as API resources with the following structure:Resource Names
Certificates follow different naming patterns depending on the owner:- DataProvider:
dataProviders/{data_provider}/certificates/{certificate} - Duchy:
duchies/{duchy}/certificates/{certificate} - MeasurementConsumer:
measurementConsumers/{measurement_consumer}/certificates/{certificate} - ModelProvider:
modelProviders/{model_provider}/certificates/{certificate}
Certificate Preference
When multiple certificates exist for a resource, the API determines preference based on the following criteria (in order of importance):Revocation Status
Not revoked certificates are preferred over revoked ones.
- Certificates in
REVOKEDorHOLDstate are deprioritized - Active certificates always take precedence
Validity Period
Certificates within their validity period are preferred.
- Current date/time must be between the certificate’s start and end dates
- Expired or not-yet-valid certificates are deprioritized
Validity End Date
Certificates with a later validity end date are preferred.
- Longer-lived certificates are prioritized
- This ensures the most up-to-date certificate is used
While it’s expected that certificates with later end dates also have later start dates, the API does not enforce this relationship. The preference algorithm handles any ordering.
Certificate Revocation
Certificates can be in one of three revocation states:REVOCATION_STATE_UNSPECIFIED
REVOCATION_STATE_UNSPECIFIED
The certificate is valid and not revoked. This is the default state for active certificates.
HOLD
HOLD
The certificate is temporarily on hold and considered invalid. This state may be reversible, though the API treats it as invalid for all operations.
REVOKED
REVOKED
The certificate has been permanently revoked. This is a terminal state - once revoked, a certificate cannot be un-revoked.
Using Certificates
In Measurements
When creating a measurement, you must specify certificates for signature verification:In Requisitions
Requisitions reference certificates from their parent Measurement:measurement_consumer_certificate- Used to verify the measurement specdata_provider_certificate- Used to verify the resultduchy_certificate- Used to verify duchy-specific signatures
Certificate Verification
When verifying a signed message:- Extract the certificate resource from the API response
- Verify the certificate chain against your trusted root certificate
- Check the certificate hasn’t been revoked
- Verify the signature using the certificate’s public key
- Validate the signed content matches expectations
Best Practices
Certificate Rotation
Regularly rotate certificates before they expire. Create new certificates while old ones are still valid to ensure smooth transitions.
Secure Storage
Store private keys securely. Never expose private keys through the API or in logs. Use hardware security modules (HSMs) when possible.
Monitor Expiration
Set up alerts for upcoming certificate expirations. Begin renewal at least 30 days before expiration.
Verify Chain
Always verify the complete certificate chain. Don’t trust certificates without validating against your root CA.
External Certificate Exchange
Since the API never returns root certificates, you must:- Exchange root certificates out-of-band - Use a secure channel outside the API (e.g., mutual TLS, signed email, in-person exchange)
- Store trusted roots securely - Maintain a secure trust store for root certificates
- Validate certificate chains - Always verify API-provided certificates against your trusted roots
Next Steps
Authentication
Learn about the authentication flow
Creating Measurements
Create your first measurement with certificates
