rsaoeap

package
v0.99999.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RSA

type RSA struct {
	// contains filtered or unexported fields
}

RSA implements the crypto.Cipher interface using RSA public/private key algorithm as specified in PKCS #1. Messages are encrypted with the public key and can only be decrypted using the private key. RSA objects must have a public key but the private key is only required for decryption.

func New

func New(key interface{}) (_ *RSA, err error)

New creates an RSA Crypto handler with the specified key pair. If the cipher is only being used for encryption, simply pass the public key: New(pub *rsa.PublicKey); If the cipher is being used for decryption, then pass the private key: New(key *rsa.PrivateKey).

func (*RSA) Decrypt

func (c *RSA) Decrypt(ciphertext []byte) (plaintext []byte, err error)

Decrypt the message using the private key.

func (*RSA) Encrypt

func (c *RSA) Encrypt(plaintext []byte) (ciphertext []byte, err error)

Encrypt the message using the public key.

func (*RSA) EncryptionAlgorithm

func (c *RSA) EncryptionAlgorithm() string

EncryptionAlgorithm returns the name of the algorithm for adding to the Transaction.

func (*RSA) PublicKeySignature added in v0.3.3

func (c *RSA) PublicKeySignature() (_ string, err error)

PublicKeySignature implements KeyIdentifier by computing a base64 encoded SHA-256 hash of the public key serialized as a PKIX public key without PEM encoding. This is a prototype method of computing the public key signature and may not match other external signature computation methods.

Jump to

Keyboard shortcuts

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