publickeycrypto

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptKeyType added in v0.1.1

type EncryptKeyType entity.EncryptKeyType

EncryptKeyType is EncryptKey KeyType

const (
	// EncryptTypeRSA is RSA KeyType
	EncryptTypeRSA EncryptKeyType = EncryptKeyType(entity.EncryptTypeRSA)
	// EncryptTypeECDSA is ECDSASA KeyType
	EncryptTypeECDSA EncryptKeyType = EncryptKeyType(entity.EncryptTypeECDSA)
	// EncryptTypeED25519 is ED25519 KeyType
	EncryptTypeED25519 EncryptKeyType = EncryptKeyType(entity.EncryptTypeED25519)
)

type PublicKeyCrypto

type PublicKeyCrypto struct {
	EncryptKey *entity.EncryptKey
	// contains filtered or unexported fields
}

PublicKeyCrypto represents PublicKeyCrypto struct

func NewPublicKeyCrypto

func NewPublicKeyCrypto(bits int, encryptType EncryptKeyType) (*PublicKeyCrypto, error)

NewPublicKeyCrypto create PublicKeyCrypto struct

func NewPublicKeyCryptoWithJWKPublicKey

func NewPublicKeyCryptoWithJWKPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)

NewPublicKeyCryptoWithJWKPublicKey create PublicKeyCrypto struct with JWK Public Key

func NewPublicKeyCryptoWithPEMPublicKey

func NewPublicKeyCryptoWithPEMPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)

NewPublicKeyCryptoWithPEMPublicKey create PublicKeyCrypto struct with PEM Public Key

func (*PublicKeyCrypto) Decrypt

func (ck *PublicKeyCrypto) Decrypt(input string) (string, error)

Decrypt decrypts input data with publickey encryption

func (*PublicKeyCrypto) Encrypt

func (ck *PublicKeyCrypto) Encrypt(input string) (string, error)

Encrypt encrypts input data with publickey encryption

func (*PublicKeyCrypto) GetPrivateKey

func (ck *PublicKeyCrypto) GetPrivateKey() ([]byte, error)

GetPrivateKey gets privatekey

func (*PublicKeyCrypto) GetPrivateKeyPKCS8

func (ck *PublicKeyCrypto) GetPrivateKeyPKCS8() ([]byte, error)

GetPrivateKeyPKCS8 gets pkcs8 privatekey

func (*PublicKeyCrypto) GetPublicKey

func (ck *PublicKeyCrypto) GetPublicKey() ([]byte, error)

GetPublicKey gets publickey

func (*PublicKeyCrypto) GetPublicKeyWithJWK

func (ck *PublicKeyCrypto) GetPublicKeyWithJWK() ([]byte, error)

GetPublicKeyWithJWK gets jwk publickey

Jump to

Keyboard shortcuts

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