jceks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BksVersionV1 = 1
	BksVersionV2 = 2
)
View Source
const (
	UberVersionV1 = 1
)

Variables

View Source
var BKSDefaultOpts = BKSOpts{
	Version:        1,
	SaltSize:       20,
	IterationCount: 10000,
}

DefaultOpts

View Source
var CipherMD5And3DES = CipherBlockCBC{
	// contains filtered or unexported fields
}
View Source
var CipherSHA1And3DES = CipherBlockCBC{
	// contains filtered or unexported fields
}
View Source
var CipherSHA1And3DESForBKS = CipherBlockCBC{
	// contains filtered or unexported fields
}

for BKS and UBER

View Source
var CipherSHA1AndTwofishForUBER = CipherBlockCBC{
	// contains filtered or unexported fields
}
View Source
var DefaultCipher = CipherMD5And3DES

默认配置 Default Cipher

View Source
var LoadFromBytes = LoadJceksFromBytes
View Source
var LoadFromReader = LoadJceksFromReader

别名

alias functions

View Source
var NewBksEncode = NewBKS

alias

View Source
var NewJceksEncode = NewJCEKS
View Source
var NewJksEncode = NewJKS

编码

View Source
var NewUberEncode = NewUBER
View Source
var UBERDefaultOpts = UBEROpts{
	SaltSize:       20,
	IterationCount: 10000,
}

UBER Default Options

Functions

func AddCipher

func AddCipher(oid asn1.ObjectIdentifier, cipher func() Cipher)

添加加密

func AddKey

func AddKey(name string, key func() Key)

添加Key

func DecodeData

func DecodeData(encodedData, password []byte) ([]byte, error)

解密数据

func DecryptedPrivateKeyInfo

func DecryptedPrivateKeyInfo(data []byte) ([]byte, error)

解密数据

func EncodeData

func EncodeData(data []byte, password string, cipher ...Cipher) ([]byte, error)

加密数据

func EncryptedPrivateKeyInfo

func EncryptedPrivateKeyInfo(algorithm asn1.ObjectIdentifier, data []byte) ([]byte, error)

加密数据

func GetPKCS8PrivateKeyAlgorithm

func GetPKCS8PrivateKeyAlgorithm(privateKey crypto.PrivateKey) (string, error)

私钥名称 GetPKCS8PrivateKeyAlgorithm

func GetPKCS8PublicKeyAlgorithm

func GetPKCS8PublicKeyAlgorithm(publicKey crypto.PublicKey) (string, error)

公钥名称 GetPKCS8PublicKeyAlgorithm

func GetStructName

func GetStructName(s any) (name string)

反射获取结构体名称 get struct name

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

根据证书名称编码证书 Marshal PKCS8 PrivateKey

func MarshalPKCS8PublicKey

func MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

从注册的证书列表编码公钥证书 MarshalPKCS8PublicKey

func ParsePKCS8PrivateKey

func ParsePKCS8PrivateKey(pkData []byte) (privateKey crypto.PrivateKey, err error)

从注册的证书列表解析证书 Parse PKCS8 PrivateKey from keys

func ParsePKCS8PublicKey

func ParsePKCS8PublicKey(pkData []byte) (publicKey crypto.PublicKey, err error)

从注册的证书列表解析公钥证书 ParsePKCS8PublicKey

Types

type BKS

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

*

  • BKS *
  • @create 2022-9-19
  • @author deatil

func LoadBksFromBytes

func LoadBksFromBytes(data []byte, password string) (*BKS, error)

LoadBksFromBytes loads the key store from the bytes data.

func LoadBksFromReader

func LoadBksFromReader(reader io.Reader, password string) (*BKS, error)

LoadBksFromReader loads the key store from the specified file.

func NewBKS

func NewBKS() *BKS

NewBKS

func (*BKS) AddCert

func (this *BKS) AddCert(alias string, certData *x509.Certificate, certChain []*x509.Certificate) error

AddCert

func (*BKS) AddCertBytes

func (this *BKS) AddCertBytes(alias string, certData []byte, certChain [][]byte) error

AddCertBytes

func (*BKS) AddKeyPrivate

func (this *BKS) AddKeyPrivate(
	alias string,
	privateKey crypto.PrivateKey,
	certChain []*x509.Certificate,
) error

AddKeyPrivate

func (*BKS) AddKeyPrivateBytes

func (this *BKS) AddKeyPrivateBytes(
	alias string,
	privateKey []byte,
	algorithm string,
	certChain [][]byte,
) error

AddKeyPrivateBytes

func (*BKS) AddKeyPrivateWithPassword

func (this *BKS) AddKeyPrivateWithPassword(
	alias string,
	privateKey crypto.PrivateKey,
	password string,
	certChain []*x509.Certificate,
) error

AddKeyPrivateWithPassword

func (*BKS) AddKeyPrivateWithPasswordBytes

func (this *BKS) AddKeyPrivateWithPasswordBytes(
	alias string,
	privateKey []byte,
	algorithm string,
	password string,
	certChain [][]byte,
) error

AddKeyPrivateWithPasswordBytes

func (*BKS) AddKeyPublic

func (this *BKS) AddKeyPublic(
	alias string,
	publicKey crypto.PublicKey,
	certChain []*x509.Certificate,
) error

AddKeyPublic

func (*BKS) AddKeyPublicBytes

func (this *BKS) AddKeyPublicBytes(
	alias string,
	publicKey []byte,
	algorithm string,
	certChain [][]byte,
) error

AddKeyPublicBytes

func (*BKS) AddKeyPublicWithPassword

func (this *BKS) AddKeyPublicWithPassword(
	alias string,
	publicKey crypto.PublicKey,
	password string,
	certChain []*x509.Certificate,
) error

AddKeyPublicWithPassword

func (*BKS) AddKeyPublicWithPasswordBytes

func (this *BKS) AddKeyPublicWithPasswordBytes(
	alias string,
	publicKey []byte,
	algorithm string,
	password string,
	certChain [][]byte,
) error

AddKeyPublicWithPasswordBytes

func (*BKS) AddKeySecret

func (this *BKS) AddKeySecret(
	alias string,
	secret []byte,
	algorithm string,
	certChain []*x509.Certificate,
) error

AddKeySecret algorithm = "AES"

func (*BKS) AddKeySecretBytes

func (this *BKS) AddKeySecretBytes(
	alias string,
	secret []byte,
	algorithm string,
	certChain [][]byte,
) error

AddKeySecretBytes algorithm = "AES"

func (*BKS) AddKeySecretWithPassword

func (this *BKS) AddKeySecretWithPassword(
	alias string,
	secret []byte,
	password string,
	algorithm string,
	certChain []*x509.Certificate,
) error

AddKeySecretWithPassword algorithm = "AES"

func (*BKS) AddKeySecretWithPasswordBytes

func (this *BKS) AddKeySecretWithPasswordBytes(
	alias string,
	secret []byte,
	password string,
	algorithm string,
	certChain [][]byte,
) error

AddKeySecretWithPasswordBytes algorithm = "AES"

func (*BKS) AddSecret

func (this *BKS) AddSecret(
	alias string,
	secretData []byte,
	certChain []*x509.Certificate,
) error

AddSecret

func (*BKS) AddSecretBytes

func (this *BKS) AddSecretBytes(
	alias string,
	secretData []byte,
	certChain [][]byte,
) error

AddSecretBytes

func (*BKS) GetCert

func (this *BKS) GetCert(alias string) (
	cert *x509.Certificate,
	err error,
)

GetCert

func (*BKS) GetCertBytes

func (this *BKS) GetCertBytes(alias string) (
	cert []byte,
	err error,
)

GetCertBytes

func (*BKS) GetCertChain

func (this *BKS) GetCertChain(alias string) (certChain []*x509.Certificate, err error)

GetCertChain

func (*BKS) GetCertChainBytes

func (this *BKS) GetCertChainBytes(alias string) (certChain [][]byte, err error)

GetCertChainBytes

func (*BKS) GetCertType

func (this *BKS) GetCertType(alias string) (certType string, err error)

GetCertType

func (*BKS) GetCreateDate

func (this *BKS) GetCreateDate(alias string) (date time.Time, err error)

GetCreateDate

func (*BKS) GetKey

func (this *BKS) GetKey(alias string) (
	private crypto.PrivateKey,
	public crypto.PublicKey,
	secret []byte,
	err error,
)

GetKey

func (*BKS) GetKeyPrivate

func (this *BKS) GetKeyPrivate(alias string) (private crypto.PrivateKey, err error)

GetKeyPrivate

func (*BKS) GetKeyPrivateWithPassword

func (this *BKS) GetKeyPrivateWithPassword(alias string, password string) (private crypto.PrivateKey, err error)

GetKeyPrivateWithPassword

func (*BKS) GetKeyPublic

func (this *BKS) GetKeyPublic(alias string) (public crypto.PublicKey, err error)

GetKeyPublic

func (*BKS) GetKeyPublicWithPassword

func (this *BKS) GetKeyPublicWithPassword(alias string, password string) (public crypto.PublicKey, err error)

GetKeyPublicWithPassword

func (*BKS) GetKeySecret

func (this *BKS) GetKeySecret(alias string) (secret []byte, err error)

GetKeySecret

func (*BKS) GetKeySecretWithPassword

func (this *BKS) GetKeySecretWithPassword(alias string, password string) (secret []byte, err error)

GetKeySecretWithPassword

func (*BKS) GetKeyType

func (this *BKS) GetKeyType(alias string) (keyType string, err error)

GetKeyType

func (*BKS) GetSealedKey

func (this *BKS) GetSealedKey(alias string, password string) (
	private crypto.PrivateKey,
	public crypto.PublicKey,
	secret []byte,
	err error,
)

GetSealedKey

func (*BKS) GetSealedKeyType

func (this *BKS) GetSealedKeyType(alias string, password string) (keyType string, err error)

GetSealedKeyType

func (*BKS) GetSecret

func (this *BKS) GetSecret(alias string) (
	secret []byte,
	err error,
)

GetSecret

func (*BKS) ListCerts

func (this *BKS) ListCerts() []string

ListCerts

func (*BKS) ListKeys

func (this *BKS) ListKeys() []string

ListKeys

func (*BKS) ListSealedKeys

func (this *BKS) ListSealedKeys() []string

ListSealedKeys

func (*BKS) ListSecrets

func (this *BKS) ListSecrets() []string

ListSecrets lists the names of the SecretKey stored in the key store.

func (*BKS) Marshal

func (this *BKS) Marshal(password string, opts ...BKSOpts) ([]byte, error)

func (*BKS) Parse

func (this *BKS) Parse(r io.Reader, password string) error

Parse

func (*BKS) StoreType

func (this *BKS) StoreType() string

func (*BKS) String

func (this *BKS) String() string

func (*BKS) Version

func (this *BKS) Version() uint32

type BKSOpts

type BKSOpts struct {
	Version        int
	SaltSize       int
	IterationCount int
}

Opts

type BksDataEntry

type BksDataEntry interface {
	GetAlias() string
	GetDate() time.Time
	GetCertChain() [][]byte
}

type BksEntry

type BksEntry interface {
	WithData(alias string, date time.Time, certChain [][]byte)
	GetData() (alias string, date time.Time, certChain [][]byte)

	IsDecrypted() bool
	Decrypt(password string) error
}

type Cipher

type Cipher interface {
	// oid
	OID() asn1.ObjectIdentifier

	// 值大小
	KeySize() int

	// 加密, 返回: [加密后数据, 参数, error]
	Encrypt(key, plaintext []byte) ([]byte, []byte, error)

	// 解密
	Decrypt(key, params, ciphertext []byte) ([]byte, error)
}

加密接口

type CipherBlockCBC

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

Cipher Block CBC mode

func (CipherBlockCBC) Decrypt

func (this CipherBlockCBC) Decrypt(password, params, ciphertext []byte) ([]byte, error)

Decrypt data

func (CipherBlockCBC) Encrypt

func (this CipherBlockCBC) Encrypt(password, plaintext []byte) ([]byte, []byte, error)

Encrypt data

func (CipherBlockCBC) KeySize

func (this CipherBlockCBC) KeySize() int

Key Size

func (CipherBlockCBC) OID

oid

func (CipherBlockCBC) WithSaltSize

func (this CipherBlockCBC) WithSaltSize(saltSize int) CipherBlockCBC

with saltSize

type JCEKS

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

*

  • JCEKS *
  • @create 2022-9-19
  • @author deatil

func LoadJceksFromBytes

func LoadJceksFromBytes(data []byte, password string) (*JCEKS, error)

LoadJceksFromBytes loads the key store from the bytes data.

func LoadJceksFromReader

func LoadJceksFromReader(reader io.Reader, password string) (*JCEKS, error)

LoadJceksFromReader loads the key store from the specified file.

func NewJCEKS

func NewJCEKS() *JCEKS

构造函数

func (*JCEKS) AddPrivateKey

func (this *JCEKS) AddPrivateKey(
	alias string,
	privateKey crypto.PrivateKey,
	password string,
	certs []*x509.Certificate,
	cipher ...Cipher,
) error

添加私钥

func (*JCEKS) AddPrivateKeyBytes

func (this *JCEKS) AddPrivateKeyBytes(
	alias string,
	privateKey []byte,
	password string,
	certs [][]byte,
	cipher ...Cipher,
) error

添加私钥

func (*JCEKS) AddSecretKey

func (this *JCEKS) AddSecretKey(
	alias string,
	secretKey []byte,
	password string,
	cipher ...Cipher,
) error

添加密钥

func (*JCEKS) AddTrustedCert

func (this *JCEKS) AddTrustedCert(
	alias string,
	cert *x509.Certificate,
) error

添加证书

func (*JCEKS) AddTrustedCertBytes

func (this *JCEKS) AddTrustedCertBytes(
	alias string,
	cert []byte,
) error

添加证书

func (*JCEKS) GetCert

func (this *JCEKS) GetCert(alias string) (*x509.Certificate, error)

GetCert

func (*JCEKS) GetCertBytes

func (this *JCEKS) GetCertBytes(alias string) ([]byte, error)

GetCertBytes

func (*JCEKS) GetPrivateKeyAndCerts

func (this *JCEKS) GetPrivateKeyAndCerts(alias string, password string) (
	key crypto.PrivateKey,
	certs []*x509.Certificate,
	err error,
)

GetPrivateKeyAndCerts

func (*JCEKS) GetPrivateKeyAndCertsBytes

func (this *JCEKS) GetPrivateKeyAndCertsBytes(alias string, password string) (
	key []byte,
	certs [][]byte,
	err error,
)

GetPrivateKeyAndCertsBytes

func (*JCEKS) GetSecretKey

func (this *JCEKS) GetSecretKey(alias string, password string) (key []byte, err error)

GetSecretKey

func (*JCEKS) ListCerts

func (this *JCEKS) ListCerts() []string

ListCerts

func (*JCEKS) ListPrivateKeys

func (this *JCEKS) ListPrivateKeys() []string

ListPrivateKeys

func (*JCEKS) ListSecretKeys

func (this *JCEKS) ListSecretKeys() []string

ListSecretKeys lists the names of the SecretKey stored in the key store.

func (*JCEKS) Marshal

func (this *JCEKS) Marshal(password string) ([]byte, error)

func (*JCEKS) Parse

func (this *JCEKS) Parse(r io.Reader, password string) error

解析

func (*JCEKS) String

func (this *JCEKS) String() string

type JKS

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

*

  • Jks *
  • @create 2022-9-19
  • @author deatil

func LoadJksFromBytes

func LoadJksFromBytes(data []byte, password string) (*JKS, error)

LoadFromBytes loads the key store from the bytes data.

func LoadJksFromReader

func LoadJksFromReader(reader io.Reader, password string) (*JKS, error)

LoadJksFromReader loads the key store from the specified file.

func NewJKS

func NewJKS() *JKS

构造函数

func (*JKS) AddEncodedPrivateKey

func (this *JKS) AddEncodedPrivateKey(
	alias string,
	encodedKey []byte,
	certChain []*x509.Certificate,
) error

添加已加密私钥

func (*JKS) AddEncodedPrivateKeyBytes

func (this *JKS) AddEncodedPrivateKeyBytes(
	alias string,
	encodedKey []byte,
	certChain [][]byte,
) error

添加已加密私钥

func (*JKS) AddPrivateKey

func (this *JKS) AddPrivateKey(
	alias string,
	privateKey crypto.PrivateKey,
	password string,
	certChain []*x509.Certificate,
) error

添加私钥

func (*JKS) AddPrivateKeyBytes

func (this *JKS) AddPrivateKeyBytes(
	alias string,
	privateKey []byte,
	password string,
	certChain [][]byte,
) error

添加私钥

func (*JKS) AddTrustedCert

func (this *JKS) AddTrustedCert(
	alias string,
	cert *x509.Certificate,
) error

添加证书

func (*JKS) AddTrustedCertBytes

func (this *JKS) AddTrustedCertBytes(
	alias string,
	cert []byte,
) error

添加证书

func (*JKS) GetCert

func (this *JKS) GetCert(alias string) (*x509.Certificate, error)

GetCert

func (*JKS) GetCertBytes

func (this *JKS) GetCertBytes(alias string) ([]byte, error)

GetCertBytes

func (*JKS) GetCertChain

func (this *JKS) GetCertChain(alias string) ([]*x509.Certificate, error)

GetCertChain

func (*JKS) GetCertChainBytes

func (this *JKS) GetCertChainBytes(alias string) ([][]byte, error)

GetCertChainBytes

func (*JKS) GetCreateDate

func (this *JKS) GetCreateDate(alias string) (time.Time, error)

GetCreateDate

func (*JKS) GetEncodedKey

func (this *JKS) GetEncodedKey(alias string) ([]byte, error)

GetEncodedKey

func (*JKS) GetPrivateKey

func (this *JKS) GetPrivateKey(alias string, password string) (crypto.PrivateKey, error)

GetPrivateKey

func (*JKS) GetPrivateKeyBytes

func (this *JKS) GetPrivateKeyBytes(alias string, password string) (crypto.PrivateKey, error)

GetPrivateKeyBytes

func (*JKS) ListCerts

func (this *JKS) ListCerts() []string

ListCerts

func (*JKS) ListPrivateKeys

func (this *JKS) ListPrivateKeys() []string

ListPrivateKeys

func (*JKS) Marshal

func (this *JKS) Marshal(password string) ([]byte, error)

func (*JKS) Parse

func (this *JKS) Parse(r io.Reader, password string) error

解析

func (*JKS) String

func (this *JKS) String() string

type Key

type Key interface {
	// 包装 PKCS8 私钥证书
	MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) (pkData []byte, err error)

	// 解析 PKCS8 私钥证书
	ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

	// 包装 PKCS8 公钥证书
	MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

	// 解析 PKCS8 公钥证书
	ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

	// 名称
	Algorithm() string
}

Key 接口

type PublicKeyDSA

type PublicKeyDSA struct{}

DSA PublicKey

func (PublicKeyDSA) Algorithm

func (this PublicKeyDSA) Algorithm() string

algorithm name

func (PublicKeyDSA) MarshalPKCS8PrivateKey

func (this PublicKeyDSA) MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

MarshalPKCS8PrivateKey

func (PublicKeyDSA) MarshalPKCS8PublicKey

func (this PublicKeyDSA) MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

MarshalPKCS8PublicKey

func (PublicKeyDSA) ParsePKCS8PrivateKey

func (this PublicKeyDSA) ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

ParsePKCS8PrivateKey

func (PublicKeyDSA) ParsePKCS8PublicKey

func (this PublicKeyDSA) ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

ParsePKCS8PublicKey

type PublicKeyECDSA

type PublicKeyECDSA struct{}

ECDSA PublicKey

func (PublicKeyECDSA) Algorithm

func (this PublicKeyECDSA) Algorithm() string

algorithm name

func (PublicKeyECDSA) MarshalPKCS8PrivateKey

func (this PublicKeyECDSA) MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

MarshalPKCS8PrivateKey

func (PublicKeyECDSA) MarshalPKCS8PublicKey

func (this PublicKeyECDSA) MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

MarshalPKCS8PublicKey

func (PublicKeyECDSA) ParsePKCS8PrivateKey

func (this PublicKeyECDSA) ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

ParsePKCS8PrivateKey

func (PublicKeyECDSA) ParsePKCS8PublicKey

func (this PublicKeyECDSA) ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

ParsePKCS8PublicKey

type PublicKeyEdDSA

type PublicKeyEdDSA struct{}

EdDSA PublicKey

func (PublicKeyEdDSA) Algorithm

func (this PublicKeyEdDSA) Algorithm() string

algorithm name

func (PublicKeyEdDSA) MarshalPKCS8PrivateKey

func (this PublicKeyEdDSA) MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

MarshalPKCS8PrivateKey

func (PublicKeyEdDSA) MarshalPKCS8PublicKey

func (this PublicKeyEdDSA) MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

MarshalPKCS8PublicKey

func (PublicKeyEdDSA) ParsePKCS8PrivateKey

func (this PublicKeyEdDSA) ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

ParsePKCS8PrivateKey

func (PublicKeyEdDSA) ParsePKCS8PublicKey

func (this PublicKeyEdDSA) ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

ParsePKCS8PublicKey

type PublicKeyRSA

type PublicKeyRSA struct{}

RSA PublicKey

func (PublicKeyRSA) Algorithm

func (this PublicKeyRSA) Algorithm() string

algorithm name

func (PublicKeyRSA) MarshalPKCS8PrivateKey

func (this PublicKeyRSA) MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

MarshalPKCS8PrivateKey

func (PublicKeyRSA) MarshalPKCS8PublicKey

func (this PublicKeyRSA) MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

MarshalPKCS8PublicKey

func (PublicKeyRSA) ParsePKCS8PrivateKey

func (this PublicKeyRSA) ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

ParsePKCS8PrivateKey

func (PublicKeyRSA) ParsePKCS8PublicKey

func (this PublicKeyRSA) ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

ParsePKCS8PublicKey

type PublicKeySM2

type PublicKeySM2 struct{}

SM2 PublicKey

func (PublicKeySM2) Algorithm

func (this PublicKeySM2) Algorithm() string

algorithm name

func (PublicKeySM2) MarshalPKCS8PrivateKey

func (this PublicKeySM2) MarshalPKCS8PrivateKey(privateKey crypto.PrivateKey) ([]byte, error)

MarshalPKCS8PrivateKey

func (PublicKeySM2) MarshalPKCS8PublicKey

func (this PublicKeySM2) MarshalPKCS8PublicKey(publicKey crypto.PublicKey) ([]byte, error)

MarshalPKCS8PublicKey

func (PublicKeySM2) ParsePKCS8PrivateKey

func (this PublicKeySM2) ParsePKCS8PrivateKey(pkData []byte) (crypto.PrivateKey, error)

ParsePKCS8PrivateKey

func (PublicKeySM2) ParsePKCS8PublicKey

func (this PublicKeySM2) ParsePKCS8PublicKey(pkData []byte) (crypto.PublicKey, error)

ParsePKCS8PublicKey

type UBER

type UBER struct {
	BKS
}

*

  • UBER *
  • @create 2022-9-19
  • @author deatil

func LoadUberFromBytes

func LoadUberFromBytes(data []byte, password string) (*UBER, error)

LoadUberFromBytes loads the key store from the bytes data.

func LoadUberFromReader

func LoadUberFromReader(reader io.Reader, password string) (*UBER, error)

LoadUberFromReader

func NewUBER

func NewUBER() *UBER

New UBER

func (*UBER) Marshal

func (this *UBER) Marshal(password string, opts ...UBEROpts) ([]byte, error)

func (*UBER) Parse

func (this *UBER) Parse(data []byte, password string) error

Parse data

type UBEROpts

type UBEROpts struct {
	SaltSize       int
	IterationCount int
}

UBER Options

Jump to

Keyboard shortcuts

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