pkcs11

package
v0.0.0-...-2db71d7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CKM_VENDOR_DEFINED  = 0x80000000
	CKM_SM2             = CKM_VENDOR_DEFINED + 0x8000
	CKM_SM3_SM2         = CKM_SM2 + 0x00000100 // SM2-SM3 sign with ASN1 encoding
	CKM_SM2_SIGN        = CKM_SM2 + 0x00000104 // SM2 sign with ASN1 encoding (no SM3 hash)
	CKM_SM2_SIGN_NO_DER = CKM_SM2 + 0x00000105 // SM2 sign with plain R|S concatenation (no SM3 hash)
)

Variables

This section is empty.

Functions

func NewPrivateKey

func NewPrivateKey(p11 *P11Handle, pk bccrypto.PublicKey) (bccrypto.PrivateKey, error)

Types

type ECDSAPrivateKey

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

func (*ECDSAPrivateKey) Bytes

func (sk *ECDSAPrivateKey) Bytes() ([]byte, error)

func (*ECDSAPrivateKey) PublicKey

func (sk *ECDSAPrivateKey) PublicKey() bccrypto.PublicKey

func (*ECDSAPrivateKey) Sign

func (sk *ECDSAPrivateKey) Sign(data []byte) ([]byte, error)

func (*ECDSAPrivateKey) SignWithOpts

func (sk *ECDSAPrivateKey) SignWithOpts(msg []byte, opts *bccrypto.SignOpts) ([]byte, error)

func (*ECDSAPrivateKey) String

func (sk *ECDSAPrivateKey) String() (string, error)

func (*ECDSAPrivateKey) ToStandardKey

func (sk *ECDSAPrivateKey) ToStandardKey() crypto.PrivateKey

func (*ECDSAPrivateKey) Type

func (sk *ECDSAPrivateKey) Type() bccrypto.KeyType

type P11Handle

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

func New

func New(lib string, label string, password string, sessionCacheSize int, hash string) (*P11Handle, error)

func (*P11Handle) GetPublicKeySKI

func (p11 *P11Handle) GetPublicKeySKI(pk bccrypto.PublicKey) ([]byte, error)

type RSAPrivateKey

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

func (*RSAPrivateKey) Bytes

func (sk *RSAPrivateKey) Bytes() ([]byte, error)

func (*RSAPrivateKey) PublicKey

func (sk *RSAPrivateKey) PublicKey() bccrypto.PublicKey

func (*RSAPrivateKey) Sign

func (sk *RSAPrivateKey) Sign(data []byte) ([]byte, error)

func (*RSAPrivateKey) SignWithOpts

func (sk *RSAPrivateKey) SignWithOpts(msg []byte, opts *bccrypto.SignOpts) ([]byte, error)

func (*RSAPrivateKey) String

func (sk *RSAPrivateKey) String() (string, error)

func (*RSAPrivateKey) ToStandardKey

func (sk *RSAPrivateKey) ToStandardKey() crypto.PrivateKey

func (*RSAPrivateKey) Type

func (sk *RSAPrivateKey) Type() bccrypto.KeyType

Jump to

Keyboard shortcuts

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