-
Notifications
You must be signed in to change notification settings - Fork 9
/
descriptor.go
44 lines (34 loc) · 1.23 KB
/
descriptor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Copyright Gen Digital Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package proof
import (
"github.com/trustbloc/did-go/doc/ld/processor"
"github.com/trustbloc/kms-go/spi/kms"
"github.com/veraison/go-cose"
)
// SupportedVerificationMethod describes verification methods that supported by proof checker.
type SupportedVerificationMethod struct {
VerificationMethodType string // verification method type from did. E.g. Ed25519VerificationKey2020, JsonWebKey2020.
KMSKeyType kms.KeyType
JWKKeyType string
JWKCurve string
RequireJWK bool
}
// LDProofDescriptor describes ld proof.
type LDProofDescriptor interface {
// GetCanonicalDocument will return normalized/canonical version of the document
GetCanonicalDocument(doc map[string]interface{}, opts ...processor.Opts) ([]byte, error)
// GetDigest returns document digest.
GetDigest(doc []byte) []byte
// ProofType return proof type.
ProofType() string
SupportedVerificationMethods() []SupportedVerificationMethod
}
// JWTProofDescriptor describes jwt proof.
type JWTProofDescriptor interface {
JWTAlgorithm() string
CWTAlgorithm() cose.Algorithm
SupportedVerificationMethods() []SupportedVerificationMethod
}