MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / UnmarshalText

Method UnmarshalText

internal/pki/encoding.go:83–95  ·  view source on GitHub ↗

UnmarshalText populates k from its PEM encoding.

(data []byte)

Source from the content-addressed store, hash-verified

81
82// UnmarshalText populates k from its PEM encoding.
83func (k *PrivateKey) UnmarshalText(data []byte) error {
84 block, _ := pem.Decode(data)
85
86 if block == nil || block.Type != pemLabelECDSAKey {
87 return fmt.Errorf("not a PEM-encoded private key")
88 }
89
90 key, err := x509.ParseECPrivateKey(block.Bytes)
91 if err == nil {
92 k.ecdsa = key
93 }
94 return err
95}

Callers 9

instanceCertificateMethod · 0.45
TestReconcileCertsFunction · 0.45
SecretFunction · 0.45
TestSecretFunction · 0.45
SecretFunction · 0.45

Calls

no outgoing calls

Tested by 3

TestReconcileCertsFunction · 0.36
TestSecretFunction · 0.36