Documentation
¶
Overview ¶
Package crypto implements verification interfaces.
Index ¶
Constants ¶
View Source
const AlgoRSAPSS = "rsapss"
AlgoRSAPSS is the algorithm name returned by the RSA-PSS signer/verifier's Name method. Use it with integrity codec location options (e.g. WithSignatureLocation) instead of retyping the bare string.
Variables ¶
View Source
var (
ErrEmptyPrivateKey = errors.New("crypto: cannot sign without a private key")
)
Functions ¶
This section is empty.
Types ¶
type Mode ¶
type Mode int
Mode selects how a signer encodes the signature it produces and which encodings a verifier accepts.
const ( // ModeAuto emits raw signature bytes and, on verification, accepts a // signature in either raw or lower-case hex form. It is the default. ModeAuto Mode = iota // ModeHex emits a lower-case hex signature and accepts only hex on // verification. ModeHex // ModeBin emits raw signature bytes and accepts only raw bytes on // verification. ModeBin )
type Signer ¶
type Signer interface {
// Name returns name of the crypto algorithm, used by signer.
Name() string
// Sign returns signature for passed data.
Sign(data []byte) ([]byte, error)
}
Signer implements high-level API for package signing.
type SignerVerifier ¶
SignerVerifier common interface.
func NewRSAPSS ¶
func NewRSAPSS(privKey rsa.PrivateKey, opts ...Option) SignerVerifier
NewRSAPSS creates new rsaPSS object that can both sign and verify. The public key is derived from the private key.
Click to show internal directories.
Click to hide internal directories.