Documentation ¶
Index ¶
- Constants
- func List(provider string, output io.Writer) error
- type IntegerError
- type Key
- func (key *Key) Certificate() []byte
- func (key *Key) Config() *config.KeyConfig
- func (key *Key) GetID() []byte
- func (key *Key) ImportCertificate(cert *x509.Certificate) error
- func (key *Key) Public() crypto.PublicKey
- func (key *Key) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)
- func (key *Key) SignContext(ctx context.Context, digest []byte, opts crypto.SignerOpts) ([]byte, error)
- type Token
- func (tok *Token) Close() error
- func (tok *Token) Config() *config.TokenConfig
- func (tok *Token) Generate(keyName string, keyType token.KeyType, bits uint) (token.Key, error)
- func (token *Token) GetKey(ctx context.Context, keyName string) (token.Key, error)
- func (tok *Token) Import(keyName string, privKey crypto.PrivateKey) (token.Key, error)
- func (tk *Token) ImportCertificate(cert *x509.Certificate, labelBase string) error
- func (tok *Token) ListKeys(opts token.ListOptions) (err error)
- func (tok *Token) Ping(ctx context.Context) error
Constants ¶
View Source
const ( CKS_RO_PUBLIC_SESSION = 0 CKS_RO_USER_FUNCTIONS = 1 CKS_RW_PUBLIC_SESSION = 2 CKS_RW_USER_FUNCTIONS = 3 CKS_RW_SO_FUNCTIONS = 4 CKA_ID = pkcs11.CKA_ID CKA_LABEL = pkcs11.CKA_LABEL CKA_SERIAL_NUMBER = pkcs11.CKA_SERIAL_NUMBER CKK_RSA = pkcs11.CKK_RSA CKK_ECDSA = pkcs11.CKK_ECDSA )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IntegerError ¶
type IntegerError struct {
Raw []byte
}
func (IntegerError) Error ¶
func (e IntegerError) Error() string
type Key ¶
type Key struct { PgpCertificate string X509Certificate string // contains filtered or unexported fields }
func (*Key) Certificate ¶
func (*Key) ImportCertificate ¶
func (key *Key) ImportCertificate(cert *x509.Certificate) error
func (*Key) SignContext ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(config *config.Config, tokenName string, pinProvider passprompt.PasswordGetter) (*Token, error)
Load a PKCS#11 provider, open a session, and login
func (*Token) Config ¶
func (tok *Token) Config() *config.TokenConfig
func (*Token) ImportCertificate ¶
func (tk *Token) ImportCertificate(cert *x509.Certificate, labelBase string) error
Click to show internal directories.
Click to hide internal directories.