package crypto

import "crypto"

Package crypto collects common cryptographic constants.

Index

Functions

func RegisterHash

func RegisterHash(h Hash, f func() hash.Hash)

RegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions.

Types

type Hash

type Hash uint

Hash identifies a cryptographic hash function that is implemented in another package.

const (
	MD4       Hash = 1 + iota // import code.google.com/p/go.crypto/md4
	MD5                       // import crypto/md5
	SHA1                      // import crypto/sha1
	SHA224                    // import crypto/sha256
	SHA256                    // import crypto/sha256
	SHA384                    // import crypto/sha512
	SHA512                    // import crypto/sha512
	MD5SHA1                   // no implementation; MD5+SHA1 used for TLS RSA
	RIPEMD160                 // import code.google.com/p/go.crypto/ripemd160

)

func (Hash) Available

func (h Hash) Available() bool

Available reports whether the given hash function is linked into the binary.

func (Hash) New

func (h Hash) New() hash.Hash

New returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary.

func (Hash) Size

func (h Hash) Size() int

Size returns the length, in bytes, of a digest resulting from the given hash function. It doesn't require that the hash function in question be linked into the program.

type PrivateKey

type PrivateKey interface{}

PrivateKey represents a private key using an unspecified algorithm.

type PublicKey

type PublicKey interface{}

PublicKey represents a public key using an unspecified algorithm.

Source Files

crypto.go

Directories

PathSynopsis
crypto/aesPackage aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
crypto/cipherPackage cipher implements standard block cipher modes that can be wrapped around low-level block cipher implementations.
crypto/desPackage des implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3.
crypto/dsaPackage dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3.
crypto/ecdsaPackage ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-3.
crypto/ellipticPackage elliptic implements several standard elliptic curves over prime fields.
crypto/hmacPackage hmac implements the Keyed-Hash Message Authentication Code (HMAC) as defined in U.S. Federal Information Processing Standards Publication 198.
crypto/md5Package md5 implements the MD5 hash algorithm as defined in RFC 1321.
crypto/randPackage rand implements a cryptographically secure pseudorandom number generator.
crypto/rc4Package rc4 implements RC4 encryption, as defined in Bruce Schneier's Applied Cryptography.
crypto/rsaPackage rsa implements RSA encryption as specified in PKCS#1.
crypto/sha1Package sha1 implements the SHA1 hash algorithm as defined in RFC 3174.
crypto/sha256Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
crypto/sha512Package sha512 implements the SHA384 and SHA512 hash algorithms as defined in FIPS 180-2.
crypto/subtlePackage subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly.
crypto/tlsPackage tls partially implements TLS 1.2, as specified in RFC 5246.
crypto/x509Package x509 parses X.509-encoded keys and certificates.
crypto/x509/pkixPackage pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
Version
v1.3.0
Published
Jun 19, 2014
Platform
darwin/amd64
Imports
2 packages
Last checked
10 minutes ago

Tools for package owners.