Documentation
¶
Overview ¶
Package signature provides internal implementations of the Signer and Verifier primitives.
Index ¶
- func HashSafeForSignature(hashAlg string) error
- func RSAValidModulusSizeInBits(m int) error
- func RSAValidPublicExponent(e int) error
- func Validate_RSA_SSA_PKCS1(hashAlg string, privKey *rsa.PrivateKey) error
- func Validate_RSA_SSA_PSS(hashAlg string, saltLen int, privKey *rsa.PrivateKey) error
- type RSA_SSA_PKCS1_Signer
- type RSA_SSA_PKCS1_Verifier
- type RSA_SSA_PSS_Signer
- type RSA_SSA_PSS_Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashSafeForSignature ¶
HashSafeForSignature checks whether a hash function is safe to use with digital signatures that require collision resistance.
func RSAValidModulusSizeInBits ¶
RSAValidModulusSizeInBits the size in bits for an RSA key.
func RSAValidPublicExponent ¶
RSAValidPublicExponent validates a public RSA exponent.
func Validate_RSA_SSA_PKCS1 ¶
func Validate_RSA_SSA_PKCS1(hashAlg string, privKey *rsa.PrivateKey) error
Validate_RSA_SSA_PKCS1 validates that the corresponding private key is valid by signing and verifying a message.
func Validate_RSA_SSA_PSS ¶
func Validate_RSA_SSA_PSS(hashAlg string, saltLen int, privKey *rsa.PrivateKey) error
Validate_RSA_SSA_PSS validates that the corresponding private key is valid by signing and verifying a message.
Types ¶
type RSA_SSA_PKCS1_Signer ¶
type RSA_SSA_PKCS1_Signer struct {
// contains filtered or unexported fields
}
RSA_SSA_PKCS1_Signer is an implementation of Signer for RSA-SSA-PKCS1.
func New_RSA_SSA_PKCS1_Signer ¶
func New_RSA_SSA_PKCS1_Signer(hashAlg string, privKey *rsa.PrivateKey) (*RSA_SSA_PKCS1_Signer, error)
New_RSA_SSA_PKCS1_Signer creates a new intance of RSA_SSA_PKCS1_Signer.
type RSA_SSA_PKCS1_Verifier ¶
type RSA_SSA_PKCS1_Verifier struct {
// contains filtered or unexported fields
}
RSA_SSA_PKCS1_Verifier is an implementation of Verifier for RSA-SSA-PKCS1.
func New_RSA_SSA_PKCS1_Verifier ¶
func New_RSA_SSA_PKCS1_Verifier(hashAlg string, pubKey *rsa.PublicKey) (*RSA_SSA_PKCS1_Verifier, error)
New_RSA_SSA_PKCS1_Verifier creates a new intance of RSASSAPKCS1Verifier.
func (*RSA_SSA_PKCS1_Verifier) Verify ¶
func (v *RSA_SSA_PKCS1_Verifier) Verify(signature, data []byte) error
Verify verifies whether the given signaure is valid for the given data. It returns an error if the signature is not valid; nil otherwise.
type RSA_SSA_PSS_Signer ¶
type RSA_SSA_PSS_Signer struct {
// contains filtered or unexported fields
}
RSA_SSA_PSS_Signer is an implementation of Signer for RSA-SSA-PSS.
func New_RSA_SSA_PSS_Signer ¶
func New_RSA_SSA_PSS_Signer(hashAlg string, saltLength int, privKey *rsa.PrivateKey) (*RSA_SSA_PSS_Signer, error)
New_RSA_SSA_PSS_Signer creates a new instance of RSA_SSA_PSS_Signer.
type RSA_SSA_PSS_Verifier ¶
type RSA_SSA_PSS_Verifier struct {
// contains filtered or unexported fields
}
RSA_SSA_PSS_Verifier is an implementation of Verifier for RSA-SSA-PSS.
func New_RSA_SSA_PSS_Verifier ¶
func New_RSA_SSA_PSS_Verifier(hashAlg string, saltLength int, pubKey *rsa.PublicKey) (*RSA_SSA_PSS_Verifier, error)
New_RSA_SSA_PSS_Verifier creates a new instance of RSA_SSA_PSS_Verifier.
func (*RSA_SSA_PSS_Verifier) Verify ¶
func (v *RSA_SSA_PSS_Verifier) Verify(signature, data []byte) error
Verify verifies whether the given signature is valid for the given data. It returns an error if the signature is not valid; nil otherwise.