alg_rsa

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 8 Imported by: 4

Documentation

Overview

Package alg_rsa provides signers and verifiers rsa-pss-sha512 and rsa-v1_5-sha256.

Index

Constants

View Source
const RSASSA_PKCS1_1_5_SHA256 = `rsa-v1_5-sha256`
View Source
const RSASSA_PSS_SHA512 = `rsa-pss-sha512`

Variables

This section is empty.

Functions

This section is empty.

Types

type RSAPKCS256

type RSAPKCS256 struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Attrs      any
}

func NewRSAPKCS256Signer

func NewRSAPKCS256Signer(key *rsa.PrivateKey) *RSAPKCS256

NewRSAPKCS256Signer returns a signing algorithm based on the provided rsa private key.

func NewRSAPKCS256Verifier

func NewRSAPKCS256Verifier(key *rsa.PublicKey) *RSAPKCS256

NewRSAPKCS256Verifier returns a verification algorithm based on the provided rsa public key.

func (RSAPKCS256) Attributes

func (a RSAPKCS256) Attributes() any

Attributes returns server-side attributes associated with the key.

func (RSAPKCS256) ContentDigest

func (a RSAPKCS256) ContentDigest() contentdigest.Digester

func (RSAPKCS256) Sign

func (a RSAPKCS256) Sign(ctx context.Context, base string) ([]byte, error)

func (RSAPKCS256) Type

func (a RSAPKCS256) Type() string

func (RSAPKCS256) Verify

func (a RSAPKCS256) Verify(ctx context.Context, base string, signature []byte) error

type RSAPSS512

type RSAPSS512 struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Attrs      any
}

func NewRSAPSS512Signer

func NewRSAPSS512Signer(key *rsa.PrivateKey) *RSAPSS512

NewRSAPSS512Signer returns a signing algorithm based on the provided rsa private key.

func NewRSAPSS512Verifier

func NewRSAPSS512Verifier(key *rsa.PublicKey) *RSAPSS512

NewRSAPSS512Verifier returns a verification algorithm based on the provided rsa public key.

func (RSAPSS512) Attributes

func (a RSAPSS512) Attributes() any

Attributes returns server-side attributes associated with the key.

func (RSAPSS512) ContentDigest

func (a RSAPSS512) ContentDigest() contentdigest.Digester

func (RSAPSS512) Sign

func (a RSAPSS512) Sign(ctx context.Context, base string) ([]byte, error)

func (RSAPSS512) Type

func (a RSAPSS512) Type() string

func (RSAPSS512) Verify

func (a RSAPSS512) Verify(ctx context.Context, base string, signature []byte) error

Jump to

Keyboard shortcuts

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