oas-attestation · crate
Declared module signatures, types, configuration, and source documentation.
Source: oas/oas/oas-attestation/src/lib.rs. SHA-256: 7effa9fd9902e4f2a6dfbb5e56081f02fd2f4eb2f75299648ce58a5cb9c64078.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
credential
oas-attestation
W3C Verifiable Credential attestation support for the Open Agent Specification (OAS).
This crate implements OAS Specification §13 — Attestation Integration, providing creation, signing, and verification of attestations about autonomous entities.
Key Types
OasCredential— W3C VC with OAS constraintsAttestationType— The six standard attestation typesCredentialProof— Ed25519Signature2020 proof- [
AttestationError] — Attestation-specific errors
Attestation Types (§13.2)
| Type | Description |
|---|---|
SecurityAudit | Results of security analysis |
BehaviorAttestation | Observed runtime behavior |
CapabilityVerification | Capability verification results |
ComplianceAttestation | Regulatory compliance |
ExpertEndorsement | Domain expert endorsement |
CommunityReview | Community-sourced review |
Example
use oas_attestation::credential::OasCredential;
use oas_attestation::types::AttestationType;
use oas_attestation::sign::sign_credential;
use oas_attestation::verify::verify_credential;
use oas_crypto::keypair::OasKeyPair;
// Build a credential
let keypair = OasKeyPair::generate();
let cred = OasCredential::builder()
.issuer("did:oas:test:hmr:auditor")
.subject_id("did:oas:test:agent:target")
.attestation_type(AttestationType::SecurityAudit)
.issuance_date("2026-01-15T00:00:00Z")
.subject_claim("auditType", serde_json::json!("codeAudit"))
.subject_claim("result", serde_json::json!("pass"))
.subject_claim("severityFindings", serde_json::json!({"critical": 0}))
.subject_claim("toolOrMethodology", serde_json::json!("OWASP"))
.subject_claim("auditDate", serde_json::json!("2026-01-15T00:00:00Z"))
.build()
.unwrap();
// Sign it
let signed = sign_credential(
&cred, &keypair,
"did:oas:test:hmr:auditor#key-1",
"2026-01-15T00:00:00Z",
).unwrap();
// Verify it
let result = verify_credential(&signed, &keypair.verifying_key_bytes());
assert!(result.is_ok());pub mod credential;Source line: 62.
data_integrity_2025
pub mod data_integrity_2025;Source line: 63.
error
pub mod error;Source line: 64.
lineage_vc
pub mod lineage_vc;Source line: 65.
oid4vp
pub mod oid4vp;Source line: 66.
presentation
pub mod presentation;Source line: 67.
proof_formats
pub mod proof_formats;Source line: 68.
sd_jwt_vc
pub mod sd_jwt_vc;Source line: 69.
sign
pub mod sign;Source line: 70.
signer
pub mod signer;Source line: 71.
types
pub mod types;Source line: 72.
vc_jose
pub mod vc_jose;Source line: 73.
verify
pub mod verify;Source line: 74.
pub use credential::ContextMode;
pub use credential::ContextMode;Source line: 76.
pub use data_integrity_2025::{
algorithm_to_cryptosuite, cryptosuite_to_algorithm, sign_credential_data_integrity, verify_credential_data_integrity, CRYPTOSUITE_BBS_2023, CRYPTOSUITE_ECDSA_2019, CRYPTOSUITE_EDDSA_2022, DATA_INTEGRITY_PROOF_TYPE, };
pub use data_integrity_2025::{
algorithm_to_cryptosuite, cryptosuite_to_algorithm, sign_credential_data_integrity,
verify_credential_data_integrity, CRYPTOSUITE_BBS_2023, CRYPTOSUITE_ECDSA_2019,
CRYPTOSUITE_EDDSA_2022, DATA_INTEGRITY_PROOF_TYPE,
};Source line: 77.
pub use error::AttestationError;
pub use error::AttestationError;Source line: 82.
pub use lineage_vc::{
lineage_proof_from_credential, lineage_proof_to_credential, LineageAttestationContext, LineageAttestationData, LineageRootKind, };
pub use lineage_vc::{
lineage_proof_from_credential, lineage_proof_to_credential, LineageAttestationContext,
LineageAttestationData, LineageRootKind,
};Source line: 83.
pub use oid4vp::{
create_authorization_request, create_oid4vp_response, verify_oid4vp_response, AuthorizationRequest, Constraints, DescriptorMap, InputDescriptor, InputField, Oid4vpResponse, PresentationDefinition, PresentationSubmission, };
pub use oid4vp::{
create_authorization_request, create_oid4vp_response, verify_oid4vp_response,
AuthorizationRequest, Constraints, DescriptorMap, InputDescriptor, InputField, Oid4vpResponse,
PresentationDefinition, PresentationSubmission,
};Source line: 87.
pub use presentation::{
is_authority_bearing, sign_presentation, verify_presentation, verify_presentation_holder_binding, verify_presentation_holder_binding_with_lineage, verify_presentation_holder_binding_with_resolved_lineage, OasPresentation, PresentationProof, };
pub use presentation::{
is_authority_bearing, sign_presentation, verify_presentation,
verify_presentation_holder_binding, verify_presentation_holder_binding_with_lineage,
verify_presentation_holder_binding_with_resolved_lineage, OasPresentation, PresentationProof,
};Source line: 92.
pub use proof_formats::{Ed25519Signature2020Format, ProofFormat, ProofFormatId};
pub use proof_formats::{Ed25519Signature2020Format, ProofFormat, ProofFormatId};Source line: 97.
pub use sd_jwt_vc::{
present_sd_jwt_vc, sign_credential_sd_jwt_vc, verify_sd_jwt_vc, Disclosure, SdJwtVc, SdJwtVcHeader, SdJwtVcPayload, SdJwtVcSignOptions, };
pub use sd_jwt_vc::{
present_sd_jwt_vc, sign_credential_sd_jwt_vc, verify_sd_jwt_vc, Disclosure, SdJwtVc,
SdJwtVcHeader, SdJwtVcPayload, SdJwtVcSignOptions,
};Source line: 98.
pub use signer::{OasKeyPairSigner, OasKeyPairVerifier, Signer, Verifier, ALG_EDDSA};
pub use signer::{OasKeyPairSigner, OasKeyPairVerifier, Signer, Verifier, ALG_EDDSA};Source line: 102.
pub use vc_jose::{
parse_jwt_vc, sign_credential_jwt_vc, verify_jwt_vc, JwtVc, JwtVcHeader, JwtVcPayload, JwtVcSignOptions, };
pub use vc_jose::{
parse_jwt_vc, sign_credential_jwt_vc, verify_jwt_vc, JwtVc, JwtVcHeader, JwtVcPayload,
JwtVcSignOptions,
};Source line: 103.