Documentation
¶
Index ¶
- func CreateKey(p *pkcs11.Ctx, s pkcs11.SessionHandle, k Key) (pub pkcs11.ObjectHandle, priv pkcs11.ObjectHandle, err error)
- func CreateSession(p *pkcs11.Ctx, slot uint, pw string, rw bool) (s pkcs11.SessionHandle, err error)
- func FindLib(lib string) (file string, err error)
- func GetCert(p *pkcs11.Ctx, s pkcs11.SessionHandle, ckaId []byte) (cert *x509.Certificate, id []byte, err error)
- func GetPublic(p *pkcs11.Ctx, s pkcs11.SessionHandle, ckaId []byte) (pub crypto.PublicKey, err error)
- func ImportCert(p *pkcs11.Ctx, s pkcs11.SessionHandle, cert *x509.Certificate, ckaId []byte, ...) (object pkcs11.ObjectHandle, err error)
- func New(module string) *pkcs11.Ctx
- func SelectSlot(p *pkcs11.Ctx) (slot uint, err error)
- func SlotInfo(p *pkcs11.Ctx, s uint, skipVerify bool) (err error)
- type Key
- type Object
- type PrivateKey
- type PrivateKeyTemplate
- type PublicKeyTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKey ¶
func CreateKey(p *pkcs11.Ctx, s pkcs11.SessionHandle, k Key) (pub pkcs11.ObjectHandle, priv pkcs11.ObjectHandle, err error)
func CreateSession ¶
func GetCert ¶
func GetCert(p *pkcs11.Ctx, s pkcs11.SessionHandle, ckaId []byte) (cert *x509.Certificate, id []byte, err error)
func GetPublic ¶
func ImportCert ¶
func ImportCert(p *pkcs11.Ctx, s pkcs11.SessionHandle, cert *x509.Certificate, ckaId []byte, label string) (object pkcs11.ObjectHandle, err error)
Types ¶
type Key ¶
type Key struct { Type string Label string CKAID string Public PublicKeyTemplate Private PrivateKeyTemplate }
type Object ¶
type Object struct { Type string Id pkcs11.ObjectHandle Value []byte Label string // contains filtered or unexported fields }
func GetObjects ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
A PrivateKey represents an RSA key
func InitPrivateKey ¶
func InitPrivateKey(p *pkcs11.Ctx, s pkcs11.SessionHandle, ckaId []byte) (*PrivateKey, error)
New returns a new private key object
func (*PrivateKey) Public ¶
func (priv *PrivateKey) Public() crypto.PublicKey
Public returns the public key corresponding to priv.
func (*PrivateKey) Sign ¶
func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) (sig []byte, err error)
Sign delegates the signing of 'msg' to the PKCS11 library.
type PrivateKeyTemplate ¶
Click to show internal directories.
Click to hide internal directories.