encryption

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBase64FromPEM

func ExtractBase64FromPEM(pemData string) (string, error)

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

Types

type KadpClient

type KadpClient struct {
	// contains filtered or unexported fields
}

func NewKADPClient

func NewKADPClient(domain, credential string) (*KadpClient, error)

func (*KadpClient) AsymmetricKeyPair

func (client *KadpClient) AsymmetricKeyPair(design algorithm.Asymmetric) (publicKey string, privateKey string, err error)

func (*KadpClient) AsymmetricPriDecrypt added in v1.0.2

func (client *KadpClient) AsymmetricPriDecrypt(ciphertext string, design algorithm.Asymmetric, privateKey string) (string, error)

func (*KadpClient) AsymmetricPubEncrypt added in v1.0.2

func (client *KadpClient) AsymmetricPubEncrypt(plaintext string, design algorithm.Asymmetric, publicKey string) (string, error)

func (*KadpClient) Decipher

func (client *KadpClient) Decipher(ciphertext string, design algorithm.Symmetry, modeVal mode.Mode, paddingVal padding.Padding, length int, label, iv string) (string, error)

func (*KadpClient) DigestEncrypt added in v1.0.2

func (client *KadpClient) DigestEncrypt(plaintext string) string

func (*KadpClient) Encipher

func (client *KadpClient) Encipher(plaintext []byte, design algorithm.Symmetry, modeVal mode.Mode, paddingVal padding.Padding, length int, label, iv string) (string, error)

func (*KadpClient) FpeDecipher

func (client *KadpClient) FpeDecipher(ciphertext string, fpe algorithm.Fpe, tweak string, radix, length int, label string, start, end int) (string, error)

func (*KadpClient) FpeEncipher

func (client *KadpClient) FpeEncipher(plaintext string, fpe algorithm.Fpe, tweak string, radix, length int, label string, start, end int) (string, error)

func (*KadpClient) RsaSignature added in v1.0.2

func (client *KadpClient) RsaSignature(plaintext, privateKey string) (string, error)

func (*KadpClient) RsaVerify added in v1.0.2

func (client *KadpClient) RsaVerify(plaintext, SignatureText, publicKey string) (bool, error)

func (*KadpClient) SM2Signature added in v1.0.2

func (client *KadpClient) SM2Signature(plaintext, privateKey string, uid []byte) (r, s string, err error)

func (*KadpClient) SM2Verify added in v1.0.2

func (client *KadpClient) SM2Verify(plaintext, publicKey, r, s string, uid []byte) (bool, error)

Jump to

Keyboard shortcuts

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