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

Method MarshalText

internal/pki/encoding.go:66–80  ·  view source on GitHub ↗

MarshalText returns a PEM encoding of k that OpenSSL understands.

()

Source from the content-addressed store, hash-verified

64
65// MarshalText returns a PEM encoding of k that OpenSSL understands.
66func (k PrivateKey) MarshalText() ([]byte, error) {
67 if k.ecdsa == nil {
68 k.ecdsa = new(ecdsa.PrivateKey)
69 }
70
71 der, err := x509.MarshalECPrivateKey(k.ecdsa)
72 if err != nil {
73 return nil, err
74 }
75
76 return pem.EncodeToMemory(&pem.Block{
77 Type: pemLabelECDSAKey,
78 Bytes: der,
79 }), nil
80}
81
82// UnmarshalText populates k from its PEM encoding.
83func (k *PrivateKey) UnmarshalText(data []byte) error {

Callers 8

instanceCertificateMethod · 0.45
basicOpenSSLVerifyFunction · 0.45
strictOpenSSLVerifyFunction · 0.45

Calls

no outgoing calls

Tested by 4

basicOpenSSLVerifyFunction · 0.36
strictOpenSSLVerifyFunction · 0.36