diff options
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) + } ) |