publickeycrypto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 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 PublicKeyCrypto

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

PublicKeyCrypto represents PublicKeyCrypto struct

func NewPublicKeyCrypto

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

NewPublicKeyCrypto create PublicKeyCrypto struct

func NewPublicKeyCryptoWithJWKPublicKey

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

NewPublicKeyCryptoWithJWKPublicKey create PublicKeyCrypto struct with JWK Public Key

func NewPublicKeyCryptoWithPEMPublicKey

func NewPublicKeyCryptoWithPEMPublicKey(publickey []byte) (*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

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