Involved Source Files Package crypto collects common cryptographic constants.
Package-Level Type Names (total 8)
/* sort by: | */
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
MessageSigner is an interface for an opaque private key that can be used for
signing operations where the message is not pre-hashed by the caller.
It is a superset of the Signer interface so that it can be passed to APIs
which accept Signer, which may try to do an interface upgrade.
MessageSigner.SignMessage and MessageSigner.Sign should produce the same
result given the same opts. In particular, MessageSigner.SignMessage should
only accept a zero opts.HashFunc if the Signer would also accept messages
which are not pre-hashed.
Implementations which do not provide the pre-hashed Sign API should implement
Signer.Sign by always returning an error. 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.( MessageSigner) SignMessage(rand io.Reader, msg []byte, opts SignerOpts) (signature []byte, err error)
MessageSigner : Signer
PrivateKey represents a private key using an unspecified algorithm.
Although this type is an empty interface for backwards compatibility reasons,
all private key types in the standard library implement the following interface
interface{
Public() crypto.PublicKey
Equal(x crypto.PrivateKey) bool
}
as well as purpose-specific interfaces such as [Signer] and [Decrypter], which
can be used for increased type safety within applications.
func crypto/ecdh.(*PrivateKey).Equal(x PrivateKey) bool
func crypto/ecdsa.(*PrivateKey).Equal(x PrivateKey) bool
func crypto/ed25519.PrivateKey.Equal(x PrivateKey) bool
func crypto/rsa.(*PrivateKey).Equal(x PrivateKey) bool
PublicKey represents a public key using an unspecified algorithm.
Although this type is an empty interface for backwards compatibility reasons,
all public key types in the standard library implement the following interface
interface{
Equal(x crypto.PublicKey) bool
}
which can be used for increased type safety within applications.
func Decrypter.Public() PublicKey
func MessageSigner.Public() PublicKey
func Signer.Public() PublicKey
func crypto/ecdh.(*PrivateKey).Public() PublicKey
func crypto/ecdsa.(*PrivateKey).Public() PublicKey
func crypto/ed25519.PrivateKey.Public() PublicKey
func crypto/rsa.(*PrivateKey).Public() PublicKey
func crypto/ecdh.(*PublicKey).Equal(x PublicKey) bool
func crypto/ecdsa.(*PublicKey).Equal(x PublicKey) bool
func crypto/ed25519.PublicKey.Equal(x PublicKey) bool
func crypto/rsa.(*PublicKey).Equal(x PublicKey) bool
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.MessageSigner(interface)
*crypto/ecdsa.PrivateKey
crypto/ed25519.PrivateKey
*crypto/rsa.PrivateKey
func SignMessage(signer Signer, rand io.Reader, msg []byte, opts SignerOpts) (signature []byte, err error)
func crypto/x509.CreateRevocationList(rand io.Reader, template *x509.RevocationList, issuer *x509.Certificate, priv Signer) ([]byte, error)
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.
The pages are generated with Goldsv0.7.7-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.