File tree Expand file tree Collapse file tree 5 files changed +18
-12
lines changed
Expand file tree Collapse file tree 5 files changed +18
-12
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ package fixchain
33import (
44 "bytes"
55 "encoding/json"
6- "encoding/pem"
7- "errors"
86 "fmt"
97 "log"
108 "strings"
@@ -33,16 +31,6 @@ func (rc bytesReadCloser) Close() error {
3331 return nil
3432}
3533
36- // CertificateFromPEM takes a string representing a certificate in PEM format
37- // and returns the corresponding x509.Certificate object.
38- func CertificateFromPEM (pemBytes string ) (* x509.Certificate , error ) {
39- block , _ := pem .Decode ([]byte (pemBytes ))
40- if block == nil {
41- return nil , errors .New ("failed to decode PEM" )
42- }
43- return x509 .ParseCertificate (block .Bytes )
44- }
45-
4634// GetTestCertificateFromPEM returns an x509.Certificate from a certificate in
4735// PEM format for testing purposes. Any errors in the PEM decoding process are
4836// reported to the testing framework.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ package fixchain
2+
3+ import (
4+ "encoding/pem"
5+ "errors"
6+
7+ "github.com/google/certificate-transparency/go/x509"
8+ )
9+
10+ // CertificateFromPEM takes a string representing a certificate in PEM format
11+ // and returns the corresponding x509.Certificate object.
12+ func CertificateFromPEM (pemBytes string ) (* x509.Certificate , error ) {
13+ block , _ := pem .Decode ([]byte (pemBytes ))
14+ if block == nil {
15+ return nil , errors .New ("failed to decode PEM" )
16+ }
17+ return x509 .ParseCertificate (block .Bytes )
18+ }
You can’t perform that action at this time.
0 commit comments