aboutsummaryrefslogtreecommitdiff
path: root/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'types.go')
-rw-r--r--types.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/types.go b/types.go
index 47fe31a..53db1a9 100644
--- a/types.go
+++ b/types.go
@@ -16,6 +16,7 @@ package pki
import (
"crypto"
+ "encoding/pem"
"io"
)
@@ -35,6 +36,9 @@ type (
// Return the original go structure of the private key.
PrivateKey() crypto.PrivateKey
+
+ // ToPem must return a pem block of the private key.
+ ToPem() (pem.Block, error)
}
// PublicKey is used by the different crypto implementations to provide the
@@ -52,4 +56,10 @@ type (
Pemmer interface {
MarshalPem() (io.WriterTo, error)
}
+
+ // ToPem returns the raw pem block to make it possible to write the result to
+ // any place.
+ PemOutput interface {
+ ToPem() (pem.Block, error)
+ }
)