aboutsummaryrefslogtreecommitdiff
path: root/crypto.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto.go')
-rw-r--r--crypto.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto.go b/crypto.go
index 30b1346..f857a78 100644
--- a/crypto.go
+++ b/crypto.go
@@ -62,6 +62,14 @@ func LoadCerts(r io.Reader) ([]*x509.Certificate, error) {
return x509.ParseCertificates(block.Bytes)
}
+func readCert(r io.Reader) (*x509.Certificate, error) {
+ der, err := ioutil.ReadAll(r)
+ if err != nil {
+ return nil, err
+ }
+ return x509.ParseCertificate(der)
+}
+
func CreatePrivFile(fname string) (io.WriteCloser, error) {
return createFile(fname, 0700)
}