MCPcopy
hub / github.com/yusing/godoxy / Load

Method Load

agent/pkg/agent/new_agent.go:61–75  ·  view source on GitHub ↗
(data string)

Source from the content-addressed store, hash-verified

59}
60
61func (p *PEMPair) Load(data string) (err error) {
62 parts := strings.Split(data, ";")
63 if len(parts) != 2 {
64 return errors.New("invalid PEM pair")
65 }
66 p.Cert, err = b64Decode(parts[0])
67 if err != nil {
68 return err
69 }
70 p.Key, err = b64Decode(parts[1])
71 if err != nil {
72 return err
73 }
74 return nil
75}
76
77func (p *PEMPair) Encrypt(encKey []byte) (PEMPair, error) {
78 cert, err := encrypt(p.Cert, encKey)

Callers 15

TestPEMPairFunction · 0.95
mainFunction · 0.95
MarshalJSONMethod · 0.80
StatusMethod · 0.80
DetailMethod · 0.80
checkUpdateStateMethod · 0.80
runningMethod · 0.80
readyMethod · 0.80
errorMethod · 0.80
NewWatcherFunction · 0.80
wakeInProgressMethod · 0.80

Calls 2

b64DecodeFunction · 0.85
NewMethod · 0.80