package crypto

Import Path
	crypto (on golang.org and go.dev)

Dependency Relation
	imports 3 packages, and imported by 9 packages

Involved Source Files
	d-> crypto.go

Exported Type Names

type Decrypter (interface) Decrypter is an interface for an opaque private key that can be used for asymmetric decryption operations. An example would be an RSA key kept in a hardware module. Decrypt decrypts msg. The opts argument should be appropriate for the primitive used. See the documentation in each implementation for details. Public returns the public key corresponding to the opaque, private key. crypto/rsa.(*PrivateKey)
type DecrypterOpts (interface) func Decrypter.Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error) func crypto/rsa.(*PrivateKey).Decrypt(rand io.Reader, ciphertext []byte, opts DecrypterOpts) (plaintext []byte, err error)
type Hash uint Hash identifies a cryptographic hash function that is implemented in another package. Available reports whether the given hash function is linked into the binary. HashFunc simply returns the value of h so that Hash implements SignerOpts. New returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary. 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. ( T) String() string T : SignerOpts T : expvar.Var T : fmt.Stringer func Hash.HashFunc() Hash func SignerOpts.HashFunc() Hash func crypto/rsa.(*PSSOptions).HashFunc() Hash func RegisterHash(h Hash, f func() hash.Hash) func crypto/rsa.SignPKCS1v15(rand io.Reader, priv *rsa.PrivateKey, hash Hash, hashed []byte) ([]byte, error) func crypto/rsa.SignPSS(rand io.Reader, priv *rsa.PrivateKey, hash Hash, digest []byte, opts *rsa.PSSOptions) ([]byte, error) func crypto/rsa.VerifyPKCS1v15(pub *rsa.PublicKey, hash Hash, hashed []byte, sig []byte) error func crypto/rsa.VerifyPSS(pub *rsa.PublicKey, hash Hash, digest []byte, sig []byte, opts *rsa.PSSOptions) error const BLAKE2b_256 const BLAKE2b_384 const BLAKE2b_512 const BLAKE2s_256 const MD4 const MD5 const MD5SHA1 const RIPEMD160 const SHA1 const SHA224 const SHA256 const SHA384 const SHA3_224 const SHA3_256 const SHA3_384 const SHA3_512 const SHA512 const SHA512_224 const SHA512_256
type PrivateKey (interface) PrivateKey represents a private key using an unspecified algorithm. func crypto/ecdsa.(*PrivateKey).Equal(x PrivateKey) bool func crypto/ed25519.PrivateKey.Equal(x PrivateKey) bool func crypto/rsa.(*PrivateKey).Equal(x PrivateKey) bool
type PublicKey (interface) PublicKey represents a public key using an unspecified algorithm. func Decrypter.Public() PublicKey func Signer.Public() PublicKey func crypto/ecdsa.(*PrivateKey).Public() PublicKey func crypto/ed25519.PrivateKey.Public() PublicKey func crypto/rsa.(*PrivateKey).Public() PublicKey func crypto/ecdsa.(*PublicKey).Equal(x PublicKey) bool func crypto/ed25519.PublicKey.Equal(x PublicKey) bool func crypto/rsa.(*PublicKey).Equal(x PublicKey) bool
type Signer (interface) Signer is an interface for an opaque private key that can be used for signing operations. For example, an RSA key kept in a hardware module. Public returns the public key corresponding to the opaque, private key. Sign signs digest with the private key, possibly using entropy from rand. For an RSA key, the resulting signature should be either a PKCS #1 v1.5 or PSS signature (as indicated by opts). For an (EC)DSA key, it should be a DER-serialised, ASN.1 signature structure. Hash implements the SignerOpts interface and, in most cases, one can simply pass in the hash function used as opts. Sign may also attempt to type assert opts to other types in order to obtain algorithm specific values. See the documentation in each package for details. Note that when a signature of a hash of a larger message is needed, the caller is responsible for hashing the larger message and passing the hash (as digest) and the hash function (as opts) to Sign. crypto/ecdsa.(*PrivateKey) crypto/ed25519.PrivateKey crypto/rsa.(*PrivateKey) func crypto/x509.CreateRevocationList(rand io.Reader, template *x509.RevocationList, issuer *x509.Certificate, priv Signer) ([]byte, error)
type SignerOpts (interface) SignerOpts contains options for signing with a Signer. HashFunc returns an identifier for the hash function used to produce the message passed to Signer.Sign, or else zero to indicate that no hashing was done. Hash crypto/rsa.(*PSSOptions) func Signer.Sign(rand io.Reader, digest []byte, opts SignerOpts) (signature []byte, err error) func crypto/ecdsa.(*PrivateKey).Sign(rand io.Reader, digest []byte, opts SignerOpts) ([]byte, error) func crypto/ed25519.PrivateKey.Sign(rand io.Reader, message []byte, opts SignerOpts) (signature []byte, err error) func crypto/rsa.(*PrivateKey).Sign(rand io.Reader, digest []byte, opts SignerOpts) ([]byte, error)
Exported Values
const BLAKE2b_256 Hash = 17 // import golang.org/x/crypto/blake2b
const BLAKE2b_384 Hash = 18 // import golang.org/x/crypto/blake2b
const BLAKE2b_512 Hash = 19 // import golang.org/x/crypto/blake2b
const BLAKE2s_256 Hash = 16 // import golang.org/x/crypto/blake2s
const MD4 Hash = 1 // import golang.org/x/crypto/md4
const MD5 Hash = 2 // import crypto/md5
const MD5SHA1 Hash = 8 // no implementation; MD5+SHA1 used for TLS RSA
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.
const RIPEMD160 Hash = 9 // import golang.org/x/crypto/ripemd160
const SHA1 Hash = 3 // import crypto/sha1
const SHA224 Hash = 4 // import crypto/sha256
const SHA256 Hash = 5 // import crypto/sha256
const SHA384 Hash = 6 // import crypto/sha512
const SHA3_224 Hash = 10 // import golang.org/x/crypto/sha3
const SHA3_256 Hash = 11 // import golang.org/x/crypto/sha3
const SHA3_384 Hash = 12 // import golang.org/x/crypto/sha3
const SHA3_512 Hash = 13 // import golang.org/x/crypto/sha3
const SHA512 Hash = 7 // import crypto/sha512
const SHA512_224 Hash = 14 // import crypto/sha512
const SHA512_256 Hash = 15 // import crypto/sha512