diff options
author | Gibheer <gibheer@gmail.com> | 2015-03-25 20:36:21 +0100 |
---|---|---|
committer | Gibheer <gibheer@gmail.com> | 2015-03-25 20:36:21 +0100 |
commit | 301d931ad76c0754e58cf024b46bebe685faafc5 (patch) | |
tree | de5c62a0d4270bc48839e977e6763646967d10aa /types.go | |
parent | b3f621a31251c225944125c17f9f97333ba33209 (diff) |
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.
Diffstat (limited to 'types.go')
-rw-r--r-- | types.go | 56 |
1 files changed, 28 insertions, 28 deletions
@@ -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) + } ) |