rs

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 7 Imported by: 2

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

func New256() sig.Algorithm

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 New256Weak() sig.Algorithm

New256Weak is same as New256, but it accepts the weak keys.

Deprecated: Use New256 instead.

func New384

func New384() sig.Algorithm

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 New384Weak() sig.Algorithm

New384Weak is same as New384, but it accepts the weak keys.

Deprecated: Use New384 instead.

func New512

func New512() sig.Algorithm

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

func New512Weak() sig.Algorithm

New512Weak is same as New512, but it accepts the weak keys.

Deprecated: Use New512 instead.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL