Documentation ¶
Overview ¶
Package rs provides the RSASSA-PKCS1-v1_5 using SHA-2 signature algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New256 ¶
New256 returns RS256 signature algorithm.
New256 doesn't accept weak keys less than 2048 bit. If you want to use weak keys, use New256Weak instead.
func New256Weak
deprecated
func New384 ¶
New384 returns RS384 signature algorithm.
New384 doesn't accept weak keys less than 2048 bit. If you want to use weak keys, use New384Weak instead.
func New384Weak
deprecated
func New512 ¶
New512 returns RS512 signature algorithm.
New512 doesn't accept weak keys less than 2048 bit. If you want to use weak keys, use New512Weak instead.
func New512Weak
deprecated
Types ¶
type Algorithm ¶
type Algorithm struct {
// contains filtered or unexported fields
}
Algorithm is RSASSA-PKCS1-v1_5.
By default, using weak keys less 2048 bits fails. If you want to use weak keys, use New256Weak, New384Weak, and New512Weak instead of New256, New384, and New512.
func (*Algorithm) NewSigningKey ¶
func (alg *Algorithm) NewSigningKey(key sig.Key) sig.SigningKey
NewKey implements github.com/shogo82148/goat/sig.Algorithm.
type SigningKey ¶
type SigningKey struct {
// contains filtered or unexported fields
}
func (*SigningKey) Sign ¶
func (key *SigningKey) Sign(payload []byte) (signature []byte, err error)
Sign implements github.com/shogo82148/goat/sig.Key.
func (*SigningKey) Verify ¶
func (key *SigningKey) Verify(payload, signature []byte) error
Verify implements github.com/shogo82148/goat/sig.Key.