Home | History | Annotate | Download | only in tls

Lines Matching refs:Certificate

30 // at least one certificate or else set GetCertificate.
62 // at least one certificate or else set GetCertificate.
73 // at least one certificate or else set GetCertificate.
174 // of files. The files must contain PEM encoded data. The certificate file
175 // may contain intermediate certificates following the leaf certificate to
176 // form a certificate chain. On successful return, Certificate.Leaf will
177 // be nil because the parsed form of the certificate is not retained.
178 func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) {
181 return Certificate{}, err
185 return Certificate{}, err
191 // PEM encoded data. On successful return, Certificate.Leaf will be nil because
192 // the parsed form of the certificate is not retained.
193 func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {
194 fail := func(err error) (Certificate, error) { return Certificate{}, err }
196 var cert Certificate
204 if certDERBlock.Type == "CERTIFICATE" {
205 cert.Certificate = append(cert.Certificate, certDERBlock.Bytes)
211 if len(cert.Certificate) == 0 {
213 return fail(errors.New("tls: failed to find any PEM data in certificate input"))
216 return fail(errors.New("tls: failed to find certificate PEM data in certificate input, but did find a private key; PEM inputs may have been switched"))
218 return fail(fmt.Errorf("tls: failed to find \"CERTIFICATE\" PEM block in certificate input after skipping PEM blocks of the following types: %v", skippedBlockTypes))
229 if len(skippedBlockTypes) == 1 && skippedBlockTypes[0] == "CERTIFICATE" {
230 return fail(errors.New("tls: found a certificate rather than a key in the PEM for the private key"))
248 x509Cert, err := x509.ParseCertificate(cert.Certificate[0])