Documentation
¶
Index ¶
Constants ¶
const ( ErrScope sterror.Scope = "Signature verification" ErrOpDSSign sterror.Op = "DummySigner.Sign" ErrOpRSASSign sterror.Op = "RSAPSSSigner.Sign" ErrOpRSASVerify sterror.Op = "RSAPSSSigner.Verify" ErrOpEDSSign sterror.Op = "ED25519Signer.Sign" ErrOpEDSVerify sterror.Op = "ED25519Signer.Verify" ErrInfoInvalidKey = "got key of type %T, expected %v" )
Scope and operations used for raising Errors of this package.
Variables ¶
var ( ErrSigning = errors.New("signature creation failed") ErrVerification = errors.New("signature verification failed") ErrInvalidKey = errors.New("invalid key type") )
Errors which may be raised and wrapped in this package.
Functions ¶
This section is empty.
Types ¶
type DummySigner ¶
type DummySigner struct{}
DummySigner implements the Signer interface. It creates signatures that are always valid.
func (DummySigner) Sign ¶
func (DummySigner) Sign(key crypto.PrivateKey, data []byte) ([]byte, error)
Sign returns a signature containing just 8 random bytes.
type ED25519Signer ¶
type ED25519Signer struct{}
func (ED25519Signer) Sign ¶
func (ED25519Signer) Sign(key crypto.PrivateKey, data []byte) ([]byte, error)
Sign signes the provided data with the key named by privKey. Problems are reported by an error wrapping SigningError.
type RSAPSSSigner ¶
type RSAPSSSigner struct{}
RSAPSSSigner implements the Signer interface. It uses SHA256 hashes and PSS signatures along with x509 certificates.
func (RSAPSSSigner) Sign ¶
func (RSAPSSSigner) Sign(key crypto.PrivateKey, data []byte) ([]byte, error)
Sign signes the provided data with the key named by privKey. The returned byte slice contains a PSS signature value. Problems are reported by an error wrapping SigningError.