import { type KeyAuthority } from './vc-proof.js'; import type { AgentPassport, Delegation, ActionReceipt } from '../types/passport.js'; import type { VerifiableCredential, VerifiablePresentation } from '../types/did.js'; /** * Create a Verifiable Credential for an Agent Passport. * The passport holder proves their identity and capabilities. */ export declare function passportToVC(passport: AgentPassport, issuerPrivateKey: string, issuerPublicKey: string): Promise; /** * Create a Verifiable Credential for a Delegation. * Proves that authority was granted from delegator to delegate. */ export declare function delegationToVC(delegation: Delegation, delegatorPrivateKey: string): Promise; /** * Create a Verifiable Credential for a Floor Attestation. * Proves an agent has attested to the Values Floor. */ export declare function floorAttestationToVC(attestation: { agentId: string; floorVersion: string; principles: string[]; extensions?: string[]; attestedAt: string; }, agentPublicKey: string, agentPrivateKey: string): Promise; /** * Create a Verifiable Credential for an Action Receipt. * Provides non-repudiable proof of agent work. */ export declare function receiptToVC(receipt: ActionReceipt, agentPrivateKey: string): Promise; /** * Create a Verifiable Presentation from a set of credentials. * The holder selectively presents credentials to a verifier. */ export declare function createPresentation(credentials: VerifiableCredential[], holderPrivateKey: string, holderPublicKey: string, options: { /** The verifier's nonce this presentation answers. REQUIRED, and required * at verification too. A presentation exists to prove a holder is * presenting to one verifier now; minting one with no challenge would * produce an artifact verifyPresentation can never accept, which is the * creator-verifier disagreement this SDK refuses to ship. */ challenge: string; /** The verifier this presentation is addressed to. Optional. */ domain?: string; }): Promise; export interface VerifyVCResult { /** Integrity AND identity binding: the credential's bytes verify under a key * the claimed issuer DID commits to. NOT an authorization decision — see * the note on issuerDID. */ valid: boolean; /** The issuer the credential claims, echoed back so the relying party can * allowlist it. Meaningful only when `valid` is true; before the binding * check this field named an issuer nobody had shown had signed anything. */ issuerDID: string; /** The proof verifies under the key its own verificationMethod names. True * on some rejected results: a forged credential can be internally * consistent and still not be the issuer's. */ proofOfPossession: boolean; /** Whether that key was shown to belong to the claimed issuer. */ keyAuthority: KeyAuthority; error?: string; } /** * Verify a Verifiable Credential. * * SCOPE OF CLAIM. * Establishes, when `valid` is true: the credential's bytes and its proof * configuration are unaltered since signing, and the signing key is the * one the DID in `issuer` commits to; the proof was made for a credential * purpose; and the credential has not expired. * Does NOT establish: that the issuer is one this relying party trusts — * that is an allowlist decision, and `issuerDID` is returned so the caller * can make it; that the claims inside are true; or that the credential has * not been revoked. * * The key is no longer taken from `proof.verificationMethod` on its own. That * field is part of the document the presenter wrote, so verifying under it * established only that whoever assembled the credential held some key. A * credential naming a trusted issuer and carrying an attacker's proof * verified, and returned the trusted issuer's DID. * * Only self-certifying DID methods can be bound without resolving a DID * document, and this surface resolves none. A credential whose issuer uses any * other method now returns keyAuthority 'unresolved' and `valid: false`. */ export declare function verifyVC(credential: VerifiableCredential, opts?: { /** Refuse unless the credential claims this exact issuer. Optional: the * binding is checked either way, and `issuerDID` is returned for callers * that allowlist after the fact. */ expectedIssuer?: string; }): Promise; export interface VerifyPresentationResult { valid: boolean; /** The holder the presentation claims, returned for allowlisting on the * same terms as issuerDID above. */ holderDID: string; proofOfPossession: boolean; keyAuthority: KeyAuthority; /** The challenge carried in the verified proof, when the proof was accepted. * Consuming it — refusing a nonce already spent — is relying-party state * and does not belong in a stateless verifier, so it is handed back rather * than enforced here. */ challenge?: string; /** The domain carried in the verified proof, on the same terms. */ domain?: string; credentialResults: Array<{ id: string; valid: boolean; error?: string; }>; error?: string; } /** * Verify a Verifiable Presentation and every credential it carries. * * SCOPE OF CLAIM. * Establishes, when `valid` is true: the presentation and its proof * configuration are unaltered since signing; the signing key is the one * the DID in `holder` commits to; the proof was made for authentication; * it carries the challenge and domain the caller expected, when the caller * expected any; and every contained credential passes verifyVC. * Does NOT establish: that the holder is entitled to present these * credentials — a presentation binds the presenter to the bytes, not the * credentials to the presenter; that the challenge has not already been * spent, which is the caller's to track; or that the holder is trusted. * * The challenge and domain are now inside the signed bytes. They used to be * attached to the proof after signing, so a presentation minted for one * verifier could be readdressed to another without invalidating it. */ export declare function verifyPresentation(presentation: VerifiablePresentation, opts: { /** The nonce this verifier issued. REQUIRED. A presentation exists to * prove a holder is presenting to this verifier now; without a challenge * to answer, a signed presentation stays valid forever and replays for * anyone who has seen it, so there is no `valid: true` without one. */ expectedChallenge: string; /** The domain this verifier expects to be addressed as. Optional: the * challenge is already a per-verifier nonce, so the domain is defence in * depth rather than the binding itself. Compared exactly when supplied. */ expectedDomain?: string; /** Refuse unless the presentation claims this exact holder. Optional: the * holder binding is checked either way and `holderDID` is returned so a * caller can allowlist after the fact. */ expectedHolder?: string; }): Promise; //# sourceMappingURL=vc.d.ts.map