rsa

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSA_OAEP  = "OAEP"
	RSA_PKCS1 = "PKCS1"
	RSA_PSS   = "PSS"
)

Variables

This section is empty.

Functions

func New

func New(keyType crypto.KeyType) (crypto.PrivateKey, error)

func NewDecryptionKey

func NewDecryptionKey(keyType crypto.KeyType) (crypto.DecryptKey, error)

Types

type PrivateKey

type PrivateKey struct {
	K *rsa.PrivateKey
	// contains filtered or unexported fields
}

func (*PrivateKey) Bytes

func (sk *PrivateKey) Bytes() ([]byte, error)

func (*PrivateKey) Decrypt

func (sk *PrivateKey) Decrypt(ciphertext []byte) ([]byte, error)

func (*PrivateKey) DecryptWithOpts

func (sk *PrivateKey) DecryptWithOpts(ciphertext []byte, opts *crypto.EncOpts) ([]byte, error)

func (*PrivateKey) EncryptKey

func (sk *PrivateKey) EncryptKey() crypto.EncryptKey

func (*PrivateKey) PublicKey

func (sk *PrivateKey) PublicKey() crypto.PublicKey

func (*PrivateKey) Sign

func (sk *PrivateKey) Sign(data []byte) ([]byte, error)

func (*PrivateKey) SignWithOpts

func (sk *PrivateKey) SignWithOpts(data []byte, opts *crypto.SignOpts) ([]byte, error)

func (*PrivateKey) String

func (sk *PrivateKey) String() (string, error)

func (*PrivateKey) ToStandardKey

func (sk *PrivateKey) ToStandardKey() crypto2.PrivateKey

func (*PrivateKey) Type

func (sk *PrivateKey) Type() crypto.KeyType

type PublicKey

type PublicKey struct {
	K *rsa.PublicKey
}

func (*PublicKey) Bytes

func (pk *PublicKey) Bytes() ([]byte, error)

func (*PublicKey) Encrypt

func (pk *PublicKey) Encrypt(data []byte) ([]byte, error)

func (*PublicKey) EncryptWithOpts

func (pk *PublicKey) EncryptWithOpts(data []byte, opts *crypto.EncOpts) ([]byte, error)

func (*PublicKey) String

func (pk *PublicKey) String() (string, error)

func (*PublicKey) ToStandardKey

func (pk *PublicKey) ToStandardKey() crypto2.PublicKey

func (*PublicKey) Type

func (pk *PublicKey) Type() crypto.KeyType

func (*PublicKey) Verify

func (pk *PublicKey) Verify(data []byte, sig []byte) (bool, error)

func (*PublicKey) VerifyWithOpts

func (pk *PublicKey) VerifyWithOpts(data []byte, sig []byte, opts *crypto.SignOpts) (bool, error)

Jump to

Keyboard shortcuts

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