From 301d931ad76c0754e58cf024b46bebe685faafc5 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 25 Mar 2015 20:36:21 +0100 Subject: reformat everything with gofmt Yes, I know that this will more or less destroy the history, but it had to be done. I also adjusted my editor to use gofmt rules by default now. --- types.go | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'types.go') diff --git a/types.go b/types.go index 5feb2b1..47fe31a 100644 --- a/types.go +++ b/types.go @@ -15,41 +15,41 @@ package pki import ( - "crypto" - "io" + "crypto" + "io" ) // This label is used as the type in the pem encoding of public keys. const PemLabelPublic = "PUBLIC KEY" type ( - // PrivateKey is a common interface for all crypto implementations to provide - // the same functions, like deriving a public key or signing a message. - PrivateKey interface { - // Derive a new public key from the private key. - Public() PublicKey - // Sign a message using the public key and the given hash method. - // To use a hash method, include the package - // import _ "crypto/sha512" - Sign(message []byte, hash crypto.Hash) ([]byte, error) + // PrivateKey is a common interface for all crypto implementations to provide + // the same functions, like deriving a public key or signing a message. + PrivateKey interface { + // Derive a new public key from the private key. + Public() PublicKey + // Sign a message using the public key and the given hash method. + // To use a hash method, include the package + // import _ "crypto/sha512" + Sign(message []byte, hash crypto.Hash) ([]byte, error) - // Return the original go structure of the private key. - PrivateKey() crypto.PrivateKey - } + // Return the original go structure of the private key. + PrivateKey() crypto.PrivateKey + } - // PublicKey is used by the different crypto implementations to provide the - // same functionality like verifying a message against a signature. - PublicKey interface { - Pemmer - // This function can be used to verify a message against a provided signature - // using the given hash function. - Verify(message []byte, signature []byte, hash crypto.Hash) (bool, error) - } + // PublicKey is used by the different crypto implementations to provide the + // same functionality like verifying a message against a signature. + PublicKey interface { + Pemmer + // This function can be used to verify a message against a provided signature + // using the given hash function. + Verify(message []byte, signature []byte, hash crypto.Hash) (bool, error) + } - // Pemmer is used by all crypto structures which need to be available - // in the pem format. The result can then be written to any structure - // implementing the io.Writer interface. - Pemmer interface { - MarshalPem() (io.WriterTo, error) - } + // Pemmer is used by all crypto structures which need to be available + // in the pem format. The result can then be written to any structure + // implementing the io.Writer interface. + Pemmer interface { + MarshalPem() (io.WriterTo, error) + } ) -- cgit v1.2.3-70-g09d2