Lines Matching refs:cert
177 func LoadX509KeyPair(certFile, keyFile string) (cert Certificate, err error) {
191 func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert Certificate, err error) {
199 cert.Certificate = append(cert.Certificate, certDERBlock.Bytes)
203 if len(cert.Certificate) == 0 {
220 cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes)
227 x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
234 priv, ok := cert.PrivateKey.(*rsa.PrivateKey)
244 priv, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
255 priv, ok := cert.PrivateKey.(ed25519.PrivateKey)
274 func isEd25519Certificate(cert *x509.Certificate) bool {
275 …return bytes.HasPrefix(cert.RawSubjectPublicKeyInfo, ed25519SPKIPrefix) && len(cert.RawSubjectPubl…
278 func getCertificatePublicKey(cert *x509.Certificate) crypto.PublicKey {
279 if cert.PublicKey != nil {
280 return cert.PublicKey
283 if isEd25519Certificate(cert) {
284 return ed25519.PublicKey(cert.RawSubjectPublicKeyInfo[len(ed25519SPKIPrefix):])