rsa

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package rsa provides a mockable wrapper for crypto/rsa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) DecryptOAEP

func (*Impl) DecryptOAEP(hash hash.Hash, random io.Reader, priv *rsa.PrivateKey, ciphertext []byte, label []byte) ([]byte, error)

func (*Impl) DecryptPKCS1v15

func (*Impl) DecryptPKCS1v15(rand io.Reader, priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)

func (*Impl) DecryptPKCS1v15SessionKey

func (*Impl) DecryptPKCS1v15SessionKey(rand io.Reader, priv *rsa.PrivateKey, ciphertext []byte, key []byte) error

func (*Impl) EncryptOAEP

func (*Impl) EncryptOAEP(hash hash.Hash, random io.Reader, pub *rsa.PublicKey, msg []byte, label []byte) ([]byte, error)

func (*Impl) EncryptPKCS1v15

func (*Impl) EncryptPKCS1v15(rand io.Reader, pub *rsa.PublicKey, msg []byte) ([]byte, error)

func (*Impl) GenerateKey

func (*Impl) GenerateKey(random io.Reader, bits int) (*rsa.PrivateKey, error)

func (*Impl) GenerateMultiPrimeKey

func (*Impl) GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*rsa.PrivateKey, error)

func (*Impl) SignPKCS1v15

func (*Impl) SignPKCS1v15(rand io.Reader, priv *rsa.PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)

func (*Impl) SignPSS

func (*Impl) SignPSS(rand io.Reader, priv *rsa.PrivateKey, hash crypto.Hash, digest []byte, opts *rsa.PSSOptions) ([]byte, error)

func (*Impl) VerifyPKCS1v15

func (*Impl) VerifyPKCS1v15(pub *rsa.PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error

func (*Impl) VerifyPSS

func (*Impl) VerifyPSS(pub *rsa.PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *rsa.PSSOptions) error

type Interface

type Interface interface {
	DecryptOAEP(hash hash.Hash, random io.Reader, priv *rsa.PrivateKey, ciphertext []byte, label []byte) ([]byte, error)
	DecryptPKCS1v15(rand io.Reader, priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
	DecryptPKCS1v15SessionKey(rand io.Reader, priv *rsa.PrivateKey, ciphertext []byte, key []byte) error
	EncryptOAEP(hash hash.Hash, random io.Reader, pub *rsa.PublicKey, msg []byte, label []byte) ([]byte, error)
	EncryptPKCS1v15(rand io.Reader, pub *rsa.PublicKey, msg []byte) ([]byte, error)
	GenerateKey(random io.Reader, bits int) (*rsa.PrivateKey, error)
	GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*rsa.PrivateKey, error)
	SignPKCS1v15(rand io.Reader, priv *rsa.PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)
	SignPSS(rand io.Reader, priv *rsa.PrivateKey, hash crypto.Hash, digest []byte, opts *rsa.PSSOptions) ([]byte, error)
	VerifyPKCS1v15(pub *rsa.PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error
	VerifyPSS(pub *rsa.PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *rsa.PSSOptions) error
}

Jump to

Keyboard shortcuts

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