rsa

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 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) ConvertJWKToPrivateKey added in v0.9.0

func (r *FastRSA) ConvertJWKToPrivateKey(data, keyID string) (string, error)

func (*FastRSA) ConvertJWKToPublicKey added in v0.9.0

func (r *FastRSA) ConvertJWKToPublicKey(data, keyID string) (string, error)

func (*FastRSA) ConvertKeyPairToPKCS12 added in v0.9.0

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

func (*FastRSA) ConvertPKCS12ToKeyPair added in v0.9.0

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

func (*FastRSA) ConvertPrivateKeyToJWK added in v0.9.0

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

func (*FastRSA) ConvertPrivateKeyToPKCS1 added in v0.9.0

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

func (*FastRSA) ConvertPrivateKeyToPKCS8 added in v0.9.0

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

func (*FastRSA) ConvertPrivateKeyToPublicKey added in v0.9.1

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

func (*FastRSA) ConvertPublicKeyToJWK added in v0.9.0

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

func (*FastRSA) ConvertPublicKeyToPKCS1 added in v0.9.0

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

func (*FastRSA) ConvertPublicKeyToPKIX added in v0.9.0

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 added in v0.9.2

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 added in v0.9.2

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

func (*FastRSA) DecryptPrivateKey added in v0.9.0

func (r *FastRSA) DecryptPrivateKey(privateKeyEncrypted, password string) (string, error)

func (*FastRSA) EncryptOAEP

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

func (*FastRSA) EncryptOAEPBytes added in v0.9.2

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 added in v0.9.2

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

func (*FastRSA) EncryptPrivateKey added in v0.9.0

func (r *FastRSA) EncryptPrivateKey(privateKey, password, cipherName string) (string, 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 added in v0.9.5

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

func (*FastRSA) MetadataPublicKey added in v0.9.5

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

func (*FastRSA) SignPKCS1v15

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

func (*FastRSA) SignPKCS1v15Bytes added in v0.9.2

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 added in v0.9.2

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 added in v0.9.2

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 added in v0.9.2

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

type HeaderPrivateKeyType added in v1.1.0

type HeaderPrivateKeyType string

type HeaderPublicKeyType added in v1.1.0

type HeaderPublicKeyType string

type KeyPair

type KeyPair struct {
	PrivateKey string
	PublicKey  string
}

type PKCS12KeyPair added in v0.9.0

type PKCS12KeyPair struct {
	PrivateKey  string
	PublicKey   string
	Certificate string
}

type PrivateKeyFormatType added in v0.9.0

type PrivateKeyFormatType int
const (
	PrivateKeyFormatTypePKCS1 PrivateKeyFormatType = iota
	PrivateKeyFormatTypePKCS8
)

type PrivateKeyInfo added in v0.9.5

type PrivateKeyInfo struct {
	BitLen int
	Size   int
	Error  string
}

type PublicKeyFormatType added in v0.9.0

type PublicKeyFormatType int
const (
	PublicKeyFormatTypePKCS1 PublicKeyFormatType = iota
	PublicKeyFormatTypePKIX
)

type PublicKeyInfo added in v0.9.5

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