-
Notifications
You must be signed in to change notification settings - Fork 0
/
persistent_storage_op_cert_store.go
83 lines (58 loc) · 2.26 KB
/
persistent_storage_op_cert_store.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package credentials
import (
"github.com/galenliu/chip/lib"
)
type PersistentStorageOpCertStore interface {
OperationalCertificateStore
HasPendingRootCert() bool
HasPendingNocChain() bool
HasCertificateForFabric(fabricIndex lib.FabricIndex, element uint8) bool
AddNewTrustedRootCertForFabric(fabricIndex lib.FabricIndex, rcac []byte) error
AddNewOpCertsForFabric(fabricIndex lib.FabricIndex, noc []byte, icac []byte) error
UpdateOpCertsForFabric(fabricIndex lib.FabricIndex, noc []byte, icac []byte) error
CommitOpCertsForFabric(fabricIndex lib.FabricIndex) error
RemoveOpCertsForFabric(fabricIndex lib.FabricIndex) error
RevertPendingOpCerts()
RevertPendingOpCertsExceptRoot()
GetCertificate(fabricIndex lib.FabricIndex, element uint8) ([]byte, error)
}
type PersistentStorageOpCertStoreImpl struct {
*OperationalCertificateStoreImpl
}
func NewPersistentStorageOpCertStoreImpl() *PersistentStorageOpCertStoreImpl {
return &PersistentStorageOpCertStoreImpl{
NewOperationalCertificateStoreImpl(),
}
}
func (s PersistentStorageOpCertStoreImpl) HasPendingRootCert() bool {
return true
}
func (s PersistentStorageOpCertStoreImpl) HasPendingNocChain() bool {
return true
}
func (s PersistentStorageOpCertStoreImpl) HasCertificateForFabric(fabricIndex lib.FabricIndex, element uint8) bool {
return true
}
func (s PersistentStorageOpCertStoreImpl) AddNewTrustedRootCertForFabric(fabricIndex lib.FabricIndex, rcac []byte) error {
return nil
}
func (s PersistentStorageOpCertStoreImpl) AddNewOpCertsForFabric(fabricIndex lib.FabricIndex, noc []byte, icac []byte) error {
return nil
}
func (s PersistentStorageOpCertStoreImpl) UpdateOpCertsForFabric(fabricIndex lib.FabricIndex, noc []byte, icac []byte) error {
//TODO implement me
panic("implement me")
}
func (s PersistentStorageOpCertStoreImpl) CommitOpCertsForFabric(fabricIndex lib.FabricIndex) error {
return nil
}
func (s PersistentStorageOpCertStoreImpl) RemoveOpCertsForFabric(fabricIndex lib.FabricIndex) error {
return nil
}
func (s PersistentStorageOpCertStoreImpl) RevertPendingOpCerts() {
}
func (s PersistentStorageOpCertStoreImpl) RevertPendingOpCertsExceptRoot() {
}
func (s PersistentStorageOpCertStoreImpl) GetCertificate(fabricIndex lib.FabricIndex, element uint8) ([]byte, error) {
return nil, nil
}