diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2017-05-12 15:27:44 +0200 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2017-05-12 15:27:44 +0200 |
commit | b6c44317f540dac8763e720767b0e73940a0b6c5 (patch) | |
tree | fac6e911056ba12da589dac4ad1f32aa63430f78 /types.go | |
parent | fd88bca2872e589b451cde3767dbc59d82bd1c83 (diff) |
add proper pem interface
This should finally resolve the completely broken and wrong API to get a
pem representation of a resource.
Diffstat (limited to 'types.go')
-rw-r--r-- | types.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) + } ) |