diff --git a/credential/auth.go b/credential/auth.go index a37173f..5a80591 100644 --- a/credential/auth.go +++ b/credential/auth.go @@ -8,8 +8,7 @@ import ( ) const ( - ClaimToService = "toService" - ProofPurposeAuthentication = "authentication" + ClaimToService = "toService" ) const ErrAuthClaim MessageError = "invalid auth claim" diff --git a/credential/generate.go b/credential/generate.go index 34c6898..368ec6d 100644 --- a/credential/generate.go +++ b/credential/generate.go @@ -11,6 +11,11 @@ import ( "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" ) +const ( + ProofPurposeAssertionMethod = "assertionMethod" + ProofPurposeAuthentication = "authentication" +) + // Generator is a verifiable credential generator. type Generator struct { vc Descriptor diff --git a/credential/template/dataset.go b/credential/template/dataset.go index 8bbd772..38c4e6a 100644 --- a/credential/template/dataset.go +++ b/credential/template/dataset.go @@ -72,7 +72,7 @@ func (d *DatasetDescriptor) IssuedAt() *time.Time { } func (d *DatasetDescriptor) ProofPurpose() string { - return "assertionMethod" + return credential.ProofPurposeAssertionMethod } func (d *DatasetDescriptor) Generate() (*bytes.Buffer, error) { diff --git a/credential/template/governance.go b/credential/template/governance.go index 74367bf..548e4ed 100644 --- a/credential/template/governance.go +++ b/credential/template/governance.go @@ -55,7 +55,7 @@ func (g *GovernanceDescriptor) IssuedAt() *time.Time { } func (g *GovernanceDescriptor) ProofPurpose() string { - return "authentication" + return credential.ProofPurposeAssertionMethod } func (g *GovernanceDescriptor) Generate() (*bytes.Buffer, error) { diff --git a/credential/template/publication.go b/credential/template/publication.go index 460ca72..25735a1 100644 --- a/credential/template/publication.go +++ b/credential/template/publication.go @@ -56,7 +56,7 @@ func (d *PublicationDescriptor) IssuedAt() *time.Time { } func (d *PublicationDescriptor) ProofPurpose() string { - return "assertionMethod" + return credential.ProofPurposeAssertionMethod } func (d *PublicationDescriptor) Generate() (*bytes.Buffer, error) {