diff --git a/pkg/doc/verifiable/signaturetype.go b/pkg/doc/verifiable/signaturetype.go index 46e4c294a..dc496b668 100644 --- a/pkg/doc/verifiable/signaturetype.go +++ b/pkg/doc/verifiable/signaturetype.go @@ -12,6 +12,8 @@ import ( "github.com/samber/lo" "github.com/trustbloc/kms-go/spi/kms" + "github.com/trustbloc/vc-go/dataintegrity/suite/ecdsa2019" + "github.com/trustbloc/vc-go/dataintegrity/suite/eddsa2022" ) // SignatureType type of signature used to sign vc. @@ -70,6 +72,11 @@ var signatureTypes = []signatureTypeDesc{ kms.ECDSASecp256k1TypeIEEEP1363, kms.ECDSAP256TypeDER, kms.ECDSAP384TypeDER, kms.RSAPS256Type, }}, + {ecdsa2019.SuiteType, Ldp, []kms.KeyType{kms.ECDSAP256TypeIEEEP1363, kms.ECDSAP384TypeIEEEP1363}}, + {ecdsa2019.SuiteTypeNew, Ldp, []kms.KeyType{kms.ECDSAP256TypeIEEEP1363, kms.ECDSAP384TypeIEEEP1363}}, + {eddsa2022.SuiteType, Ldp, []kms.KeyType{kms.ED25519Type}}, + {eddsa2022.SuiteType2, Ldp, []kms.KeyType{kms.ED25519Type}}, + {EdDSA, Jwt, []kms.KeyType{kms.ED25519Type}}, {ES256K, Jwt, []kms.KeyType{kms.ECDSASecp256k1TypeIEEEP1363, kms.ECDSASecp256k1DER}}, diff --git a/pkg/doc/verifiable/signaturetype_test.go b/pkg/doc/verifiable/signaturetype_test.go index ea70958d9..a7bda05f6 100644 --- a/pkg/doc/verifiable/signaturetype_test.go +++ b/pkg/doc/verifiable/signaturetype_test.go @@ -137,7 +137,7 @@ func TestGetSignatureTypesByKeyTypeFormat(t *testing.T) { require.Equal(t, EdDSA, sigTypes[0]) sigTypes = GetSignatureTypesByKeyTypeFormat(kms.ED25519Type, Ldp) - require.Len(t, sigTypes, 3) + require.Len(t, sigTypes, 5) require.Contains(t, sigTypes, Ed25519Signature2018) require.Contains(t, sigTypes, Ed25519Signature2020) require.Contains(t, sigTypes, JSONWebSignature2020) diff --git a/pkg/service/oidc4vp/oidc4vp_service_test.go b/pkg/service/oidc4vp/oidc4vp_service_test.go index 0ccbc3005..54626bdfd 100644 --- a/pkg/service/oidc4vp/oidc4vp_service_test.go +++ b/pkg/service/oidc4vp/oidc4vp_service_test.go @@ -1938,11 +1938,15 @@ func Test_GetSupportedVPFormats(t *testing.T) { "Ed25519Signature2018", "Ed25519Signature2020", "JsonWebSignature2020", + "eddsa-rdfc-2022", + "eddsa-2022", }}, LdpVP: &presexch.LdpType{ProofType: []string{ "Ed25519Signature2018", "Ed25519Signature2020", "JsonWebSignature2020", + "eddsa-rdfc-2022", + "eddsa-2022", }}, }, }, @@ -1974,6 +1978,58 @@ func Test_GetSupportedVPFormats(t *testing.T) { LdpVP: nil, }, }, + { + name: "Ldp VC and VP with ECDSA P-256", + args: args{ + kmsSupportedKeyTypes: []kms.KeyType{ + kms.ECDSAP256TypeIEEEP1363, + }, + supportedVPFormats: []vcsverifiable.Format{ + vcsverifiable.Ldp, + }, + supportedVCFormats: []vcsverifiable.Format{ + vcsverifiable.Ldp, + }, + }, + want: &presexch.Format{ + JwtVC: nil, + JwtVP: nil, + LdpVC: &presexch.LdpType{ProofType: []string{ + "ecdsa-2019", + "ecdsa-rdfc-2019", + }}, + LdpVP: &presexch.LdpType{ProofType: []string{ + "ecdsa-2019", + "ecdsa-rdfc-2019", + }}, + }, + }, + { + name: "Ldp VC and VP with ECDSA P-384", + args: args{ + kmsSupportedKeyTypes: []kms.KeyType{ + kms.ECDSAP384TypeIEEEP1363, + }, + supportedVPFormats: []vcsverifiable.Format{ + vcsverifiable.Ldp, + }, + supportedVCFormats: []vcsverifiable.Format{ + vcsverifiable.Ldp, + }, + }, + want: &presexch.Format{ + JwtVC: nil, + JwtVP: nil, + LdpVC: &presexch.LdpType{ProofType: []string{ + "ecdsa-2019", + "ecdsa-rdfc-2019", + }}, + LdpVP: &presexch.LdpType{ProofType: []string{ + "ecdsa-2019", + "ecdsa-rdfc-2019", + }}, + }, + }, } for _, tt := range tests {