From f9164f3f99edf4ae8343d6c67b915e788a5624f8 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Sun, 15 Feb 2015 21:04:59 +0100 Subject: initial commit for pki pki is a small library to make building some of the crypto stuff easier in go. --- types.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 types.go (limited to 'types.go') diff --git a/types.go b/types.go new file mode 100644 index 0000000..e9326ee --- /dev/null +++ b/types.go @@ -0,0 +1,31 @@ +package pkilib + +import ( + "crypto" +) + +// this file holds all the interfaces used in the program until it can be split +// properly + +type ( + // interface for any private key + PrivateKey interface { + // derive a public key from the private key + Public() PublicKey + // sign a message with the private key + Sign(message []byte) ([]byte, error) + + // return the private key structure + privateKey() crypto.PrivateKey + } + + // interface for any public key + PublicKey interface { + // use the public key to verify a message against a signature + Verify(message []byte, signature []byte) (bool, error) + } + + Pemmer interface { + MarshalPem() (marshalledPemBlock, error) + } +) -- cgit v1.2.3-70-g09d2