Table of Contents

Class DcApiPresentationRequestBuilder

Namespace
Tessio.Verifier.OpenId4Vp
Assembly
Tessio.Verifier.OpenId4Vp.dll

Builds OpenID4VP requests for the W3C Digital Credentials API, unsigned or signed.

public sealed class DcApiPresentationRequestBuilder
Inheritance
DcApiPresentationRequestBuilder
Inherited Members

Remarks

Constructed without signing options it builds unsigned requests only. Constructed with them it builds both, and signs a request whose options name a ClientId. Signing shares the redirect flow's signer, so the header and the certificate chain rules are the same for both transports.

The page sends what this returns and hands the verifier back the data of the credential it receives, which ParseDcApiAsync(string, CancellationToken) reads.

Constructors

DcApiPresentationRequestBuilder(TimeProvider?)

Creates a builder for unsigned requests only.

public DcApiPresentationRequestBuilder(TimeProvider? clock = null)

Parameters

clock TimeProvider

Time source for ExpiresAt; the system clock when null.

DcApiPresentationRequestBuilder(PresentationRequestBuilderOptions)

Creates a builder that signs with signing. Only its signing credentials, certificate chain, default lifetime and clock are used; the redirect-only members are ignored.

public DcApiPresentationRequestBuilder(PresentationRequestBuilderOptions signing)

Parameters

signing PresentationRequestBuilderOptions

Exceptions

ArgumentNullException

signing or its credentials are null.

ArgumentException

The certificate chain breaks a rule, as for SignedPresentationRequestBuilder.

Fields

SignedProtocol

The protocol identifier of a signed request in JWS Compact Serialization.

public const string SignedProtocol = "openid4vp-v1-signed"

Field Value

string

UnsignedProtocol

The protocol identifier of an unsigned request.

public const string UnsignedProtocol = "openid4vp-v1-unsigned"

Field Value

string

Methods

Build(DcApiPresentationRequestOptions)

Builds the request.

public DcApiPresentationRequest Build(DcApiPresentationRequestOptions options)

Parameters

options DcApiPresentationRequestOptions

Returns

DcApiPresentationRequest

Exceptions

ArgumentException

The options name no expected origin or one that is not a serialized origin, lack vp_formats_supported, ask for an encrypted response without exactly one key or sign under the origin: prefix.

InvalidOperationException

A signed request was asked of a builder with no signing options.