kadp

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FF1    Fpe        = "FF1"
	FF3    Fpe        = "FF1_3"
	AES    Symmetry   = "AES"
	SM4    Symmetry   = "SM4"
	DES    Symmetry   = "DES"
	SM2    Asymmetric = "SM2"
	RSA    Asymmetric = "RSA"
	SM3    Digest     = "SM3"
	Sha1   Hash       = "SHA-1"
	Sha256 Hash       = "SHA-256"
)

Variables

This section is empty.

Functions

func ExtractBase64FromPEM

func ExtractBase64FromPEM(pemData string) (string, error)

Types

type Asymmetric

type Asymmetric string

type Digest

type Digest string

type Fpe

type Fpe string

type Hash

type Hash string

type KadpClient

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

func NewKADPClient

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

NewKADPClient 初始化KADP

func (*KadpClient) AsymmetricKeyPair

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

func (*KadpClient) AsymmetricPriDecrypt

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

func (*KadpClient) AsymmetricPubEncrypt

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

func (*KadpClient) Decipher

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

func (*KadpClient) DigestEncrypt

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

func (*KadpClient) Encipher

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

func (*KadpClient) FpeDecipher

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

func (*KadpClient) FpeEncipher

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

func (*KadpClient) Hmac

func (client *KadpClient) Hmac(message []byte, label string, length int) (string, error)

func (*KadpClient) HmacVerify

func (client *KadpClient) HmacVerify(message []byte, hmacVal, label string, length int) (bool, error)

func (*KadpClient) RsaSignature

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

func (*KadpClient) RsaVerify

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

func (*KadpClient) SHASum

func (client *KadpClient) SHASum(message []byte, shaHash Hash) (string, error)

func (*KadpClient) SM2Signature

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

func (*KadpClient) SM2Verify

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

type Mode

type Mode string
const (
	CBC Mode = "CBC"
	ECB Mode = "ECB"
	CTR Mode = "CTR"
	CFB Mode = "CFB"
	OFB Mode = "OFB"
	CGM Mode = "CGM"
)

type Padding

type Padding string
const (
	NoPadding       Padding = "NoPadding"
	PKCS5Padding    Padding = "PKCS5Padding"
	PKCS7Padding    Padding = "PKCS7Padding"
	ISO10126Padding Padding = "ISO10126Padding"
	ZeroPadding     Padding = "ZeroPadding"
)

type Symmetry

type Symmetry string

Jump to

Keyboard shortcuts

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