rsa

package
v0.0.0-...-e20b906 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptOAEP

func DecryptOAEP(priv *rsa.PrivateKey, msg []byte) ([]byte, error)

DecryptOAEP decrypts a msg using RSA-OAEP.

func EncryptOAEP

func EncryptOAEP(pub *rsa.PublicKey, msg []byte) ([]byte, error)

EncryptOAEP encrypts a msg using RSA-OAEP.

func SignPKCS1

func SignPKCS1(priv *rsa.PrivateKey, msg []byte) ([]byte, error)

SignPKCS1 calculates the signature of msg using RSASSA-PKCS1-v1_5. The opts argument may be nil, in which case sensible defaults are used. Warning, msg will be hashed with SHA-256.

func SignPSS

func SignPSS(priv *rsa.PrivateKey, msg []byte) ([]byte, error)

SignPSS calculates the signature of msg using RSA-PSS. The opts argument may be nil, in which case sensible defaults are used. Warning, msg will be hashed with SHA-256. Salt length is 128.

func VerifyPKCS1

func VerifyPKCS1(pub *rsa.PublicKey, sig, msg []byte) error

VerifyPKCS1 verifies the signature sig of msg using the public key pub. A valid signature is indicated by returning a nil error.

func VerifyPSS

func VerifyPSS(pub *rsa.PublicKey, sig, msg []byte) error

VerifyPSS verifies the signature sig of msg using the public key pub. A valid signature is indicated by returning a nil error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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