MCPcopy
hub / github.com/sideshow/apns2 / FromP12File

Function FromP12File

certificate/certificate.go:31–37  ·  view source on GitHub ↗

FromP12File loads a PKCS#12 certificate from a local file and returns a tls.Certificate. Use "" as the password argument if the PKCS#12 certificate is not password protected.

(filename string, password string)

Source from the content-addressed store, hash-verified

29// Use "" as the password argument if the PKCS#12 certificate is not password
30// protected.
31func FromP12File(filename string, password string) (tls.Certificate, error) {
32 p12bytes, err := os.ReadFile(filename)
33 if err != nil {
34 return tls.Certificate{}, err
35 }
36 return FromP12Bytes(p12bytes, password)
37}
38
39// FromP12Bytes loads a PKCS#12 certificate from an in memory byte array and
40// returns a tls.Certificate.

Callers 10

TestDialTLSTimeoutFunction · 0.92
TestNoSuchFileP12FileFunction · 0.92
TestBadPasswordP12FileFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92

Calls 1

FromP12BytesFunction · 0.85