Skip to content

Commit

Permalink
feat: Handling oidc4vc types with enum #1744
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Jul 27, 2023
1 parent 69a0997 commit c8a23f1
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ebsi/lib/ebsi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ library ebsi;

export 'src/ebsi.dart';
export 'src/issuer_token_parameters.dart';
export 'src/oidc4vc_enum.dart';
export 'src/token_parameters.dart';
export 'src/verification_type.dart';
export 'src/verifier_token_parameters.dart';
186 changes: 186 additions & 0 deletions packages/ebsi/lib/src/oidc4vc_enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
enum OIDC4VC {
EBSIV2(
issuerVcType: 'jwt_vc',
verifierVpType: 'jwt_vp',
offerPrefix: 'openid://initiate_issuance',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: ['did:ebsi'],
grantTypesSupported: [
'authorization_code',
'urn:ietf:params:oauth:grant-type:pre-authorized_code'
],
credentialSupported: ['VerifiableDiploma', 'VerifiableId'],
schemaForType: true,
oidc4VciDraft:
'https://openid.net/specs/openid-connect-4-verifiable-credential-issuance-1_0-05.html#abstract',
siopv2Draft: '',
serviceDocumentation:
'It is the profile of the EBSI V2 compliant test. DID for natural person is did:ebsi. The schema url is used as the VC type in the credential offer QR code. The prefix openid_initiate_issuance://'),

EBSIV3(
issuerVcType: 'jwt_vc',
verifierVpType: 'jwt_vp',
offerPrefix: 'openid://initiate_issuance',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
credentialSupported: ['VerifiableDiploma', 'VerifiableId'],
grantTypesSupported: [
'authorization_code',
'urn:ietf:params:oauth:grant-type:pre-authorized_code'
],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: ['did:key'],
schemaForType: false,
oidc4VciDraft:
'https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html',
siopv2Draft: '',
serviceDocumentation: '',
),

GAIAX(
issuerVcType: 'ldp_vc',
verifierVpType: 'ldp_vp',
offerPrefix: 'openid-initiate-issuance://',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
credentialSupported: ['EmployeeCredential'],
grantTypesSupported: [
'authorization_code',
'urn:ietf:params:oauth:grant-type:pre-authorized_code'
],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: ['did:key'],
schemaForType: false,
oidc4VciDraft:
'https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html',
siopv2Draft: '',
serviceDocumentation: 'Issuer pour projet Docaposte Gaia-X',
),

DEFAULT(
issuerVcType: 'ldp_vc',
verifierVpType: 'ldp_vp',
offerPrefix: 'openid-credential-offer://',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
credentialSupported: [],
grantTypesSupported: [
'authorization_code',
'urn:ietf:params:oauth:grant-type:pre-authorized_code'
],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: [
'did:ebsi',
'did:key',
'did:ethr',
'did:tz'
],
schemaForType: false,
oidc4VciDraft:
'https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html',
siopv2Draft: '',
serviceDocumentation: 'Last release of the OIDC4VC documentation'),

ARF(
issuerVcType: 'jwt_vc',
verifierVpType: 'jwt_vp',
offerPrefix: 'openid-credential-offer://',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
credentialSupported: [],
grantTypesSupported: [
'authorization_code',
'urn:ietf:params:oauth:grant-type:pre-authorized_code'
],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: ['did:ebsi', 'did:key', 'did:ethr', 'did:tz'],
schemaForType: false,
oidc4VciDraft: '',
siopv2Draft: '',
serviceDocumentation: '',
),

JWTVC(
issuerVcType: 'jwt_vc',
offerPrefix: '',
verifierVpType: 'jwt_vp',
presentationPrefix: 'openid-vc://',
cryptographicBindingMethodsSupported: ['DID'],
credentialSupported: [],
grantTypesSupported: [],
cryptographicSuitesSupported: [
'ES256K',
'ES256',
'ES384',
'ES512',
'RS256'
],
subjectSyntaxTypesSupported: ['did:ion'],
schemaForType: false,
oidc4VciDraft: '',
siopv2Draft: '',
serviceDocumentation: '',
);

const OIDC4VC({
required this.issuerVcType,
required this.verifierVpType,
required this.offerPrefix,
required this.presentationPrefix,
required this.cryptographicBindingMethodsSupported,
required this.cryptographicSuitesSupported,
required this.subjectSyntaxTypesSupported,
required this.grantTypesSupported,
required this.credentialSupported,
required this.schemaForType,
required this.oidc4VciDraft,
required this.siopv2Draft,
required this.serviceDocumentation,
});

final String issuerVcType;
final String verifierVpType;
final String offerPrefix;
final String presentationPrefix;
final List<String> cryptographicBindingMethodsSupported;
final List<String> cryptographicSuitesSupported;
final List<String> subjectSyntaxTypesSupported;
final List<String> grantTypesSupported;
final List<String> credentialSupported;
final bool schemaForType;
final String oidc4VciDraft;
final String siopv2Draft;
final String serviceDocumentation;
}

0 comments on commit c8a23f1

Please sign in to comment.