rsa

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderPublicKeyPKCS1 = HeaderPublicKeyType("RSA PUBLIC KEY")
	HeaderPublicKeyPKIX  = HeaderPublicKeyType("PUBLIC KEY")
)
View Source
const (
	HeaderPrivateKeyPKCS1 = HeaderPrivateKeyType("RSA PRIVATE KEY")
	HeaderPrivateKeyPKCS8 = HeaderPrivateKeyType("PRIVATE KEY")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FastRSA

type FastRSA struct {
}

func NewFastRSA

func NewFastRSA() *FastRSA

func (*FastRSA) Base64

func (r *FastRSA) Base64(message string) (string, error)

func (*FastRSA) ConvertKeyPairToPKCS12

func (r *FastRSA) ConvertKeyPairToPKCS12(privateKey, certificate, password string) (string, error)

func (*FastRSA) ConvertPKCS12ToKeyPair

func (r *FastRSA) ConvertPKCS12ToKeyPair(pkcs12, password string) (*PKCS12KeyPair, error)

func (*FastRSA) ConvertPrivateKeyToJWK

func (r *FastRSA) ConvertPrivateKeyToJWK(privateKey string) (string, error)

func (*FastRSA) ConvertPrivateKeyToPKCS1

func (r *FastRSA) ConvertPrivateKeyToPKCS1(privateKey string) (string, error)

func (*FastRSA) ConvertPrivateKeyToPKCS8

func (r *FastRSA) ConvertPrivateKeyToPKCS8(privateKey string) (string, error)

func (*FastRSA) ConvertPrivateKeyToPublicKey

func (r *FastRSA) ConvertPrivateKeyToPublicKey(privateKey string) (string, error)

func (*FastRSA) ConvertPublicKeyToJWK

func (r *FastRSA) ConvertPublicKeyToJWK(privateKey string) (string, error)

func (*FastRSA) ConvertPublicKeyToPKCS1

func (r *FastRSA) ConvertPublicKeyToPKCS1(publicKey string) (string, error)

func (*FastRSA) ConvertPublicKeyToPKIX

func (r *FastRSA) ConvertPublicKeyToPKIX(publicKey string) (string, error)

func (*FastRSA) DecryptOAEP

func (r *FastRSA) DecryptOAEP(ciphertext, label, hashName, privateKey string) (string, error)

func (*FastRSA) DecryptOAEPBytes

func (r *FastRSA) DecryptOAEPBytes(ciphertext []byte, label, hashName, privateKey string) ([]byte, error)

func (*FastRSA) DecryptPKCS1v15

func (r *FastRSA) DecryptPKCS1v15(ciphertext, privateKey string) (string, error)

func (*FastRSA) DecryptPKCS1v15Bytes

func (r *FastRSA) DecryptPKCS1v15Bytes(ciphertext []byte, privateKey string) ([]byte, error)

func (*FastRSA) EncryptOAEP

func (r *FastRSA) EncryptOAEP(message, label, hashName, publicKey string) (string, error)

func (*FastRSA) EncryptOAEPBytes

func (r *FastRSA) EncryptOAEPBytes(message []byte, label, hashName, publicKey string) ([]byte, error)

func (*FastRSA) EncryptPKCS1v15

func (r *FastRSA) EncryptPKCS1v15(message, publicKey string) (string, error)

func (*FastRSA) EncryptPKCS1v15Bytes

func (r *FastRSA) EncryptPKCS1v15Bytes(message []byte, publicKey string) ([]byte, error)

func (*FastRSA) Generate

func (r *FastRSA) Generate(nBits int) (*KeyPair, error)

func (*FastRSA) Hash

func (r *FastRSA) Hash(message, name string) (string, error)

func (*FastRSA) MetadataPrivateKey

func (r *FastRSA) MetadataPrivateKey(privateKey string) (*PrivateKeyInfo, error)

func (*FastRSA) MetadataPublicKey

func (r *FastRSA) MetadataPublicKey(publicKey string) (*PublicKeyInfo, error)

func (*FastRSA) SignPKCS1v15

func (r *FastRSA) SignPKCS1v15(message, hashName, privateKey string) (string, error)

func (*FastRSA) SignPKCS1v15Bytes

func (r *FastRSA) SignPKCS1v15Bytes(message []byte, hashName, privateKey string) ([]byte, error)

func (*FastRSA) SignPSS

func (r *FastRSA) SignPSS(message, hashName, saltLengthName, privateKey string) (string, error)

func (*FastRSA) SignPSSBytes

func (r *FastRSA) SignPSSBytes(message []byte, hashName, saltLengthName, privateKey string) ([]byte, error)

func (*FastRSA) VerifyPKCS1v15

func (r *FastRSA) VerifyPKCS1v15(signature, message, hashName, publicKey string) (bool, error)

func (*FastRSA) VerifyPKCS1v15Bytes

func (r *FastRSA) VerifyPKCS1v15Bytes(signature, message []byte, hashName, publicKey string) (bool, error)

func (*FastRSA) VerifyPSS

func (r *FastRSA) VerifyPSS(signature, message, hashName, saltLengthName, publicKey string) (bool, error)

func (*FastRSA) VerifyPSSBytes

func (r *FastRSA) VerifyPSSBytes(signature, message []byte, hashName, saltLengthName, publicKey string) (bool, error)

type HeaderPrivateKeyType

type HeaderPrivateKeyType string

type HeaderPublicKeyType

type HeaderPublicKeyType string

type KeyPair

type KeyPair struct {
	PrivateKey string
	PublicKey  string
}

type PKCS12KeyPair

type PKCS12KeyPair struct {
	PrivateKey  string
	PublicKey   string
	Certificate string
}

type PrivateKeyFormatType

type PrivateKeyFormatType int
const (
	PrivateKeyFormatTypePKCS1 PrivateKeyFormatType = iota
	PrivateKeyFormatTypePKCS8
)

type PrivateKeyInfo

type PrivateKeyInfo struct {
	BitLen int
	Size   int
	Error  string
}

type PublicKeyFormatType

type PublicKeyFormatType int
const (
	PublicKeyFormatTypePKCS1 PublicKeyFormatType = iota
	PublicKeyFormatTypePKIX
)

type PublicKeyInfo

type PublicKeyInfo struct {
	BitLen int
	Size   int
	E      int
}

Jump to

Keyboard shortcuts

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