forked from hyperledger-archives/aries-framework-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdr.go
51 lines (39 loc) · 1.05 KB
/
vdr.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
45
46
47
48
49
50
51
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package key
import (
"fmt"
diddoc "github.com/Universal-Health-Chain/aries-framework-go/pkg/doc/did"
vdrapi "github.com/Universal-Health-Chain/aries-framework-go/pkg/framework/aries/api/vdr"
)
const (
// DIDMethod did method.
DIDMethod = "key"
// EncryptionKey encryption key.
EncryptionKey = "encryptionKey"
)
// VDR implements did:key method support.
type VDR struct {
}
// New returns new instance of VDR that works with did:key method.
func New() *VDR {
return &VDR{}
}
// Accept accepts did:key method.
func (v *VDR) Accept(method string) bool {
return method == DIDMethod
}
// Close frees resources being maintained by VDR.
func (v *VDR) Close() error {
return nil
}
// Update did doc.
func (v *VDR) Update(didDoc *diddoc.Doc, opts ...vdrapi.DIDMethodOption) error {
return fmt.Errorf("not supported")
}
// Deactivate did doc.
func (v *VDR) Deactivate(didID string, opts ...vdrapi.DIDMethodOption) error {
return fmt.Errorf("not supported")
}