Versions in this module Expand all Collapse all v0 v0.3.1 Feb 23, 2024 v0.3.0 Nov 14, 2023 Changes in this version + var P224oid = asn1.ObjectIdentifier + var P256oid = asn1.ObjectIdentifier + var P384oid = asn1.ObjectIdentifier + var P521oid = asn1.ObjectIdentifier + func AttributeToString(attribute *pkcs11.Attribute) string + func CurveNameToCurve(curveName string) (curve elliptic.Curve, err error) + func CurveNameToECParams(curveName string) ([]byte, error) + func CurveNameToOid(curveName string) (curve asn1.ObjectIdentifier, err error) + func ECParamsToCurve(ecParams []byte) (elliptic.Curve, error) + func OidToCurveName(curve asn1.ObjectIdentifier) (name string, err error) + func StringToAttribute(algo string) (*pkcs11.Attribute, error) + type P11 struct + Ctx *pkcs11.Ctx + Sessions map[uint]pkcs11.SessionHandle + func NewP11(modulePath string, logger pterm.Logger) (*P11, error) + func (p *P11) CloseAllSessions() error + func (p *P11) ExportCertificate(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle) ([]byte, error) + func (p *P11) ExportPrivateKey(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle) ([]byte, error) + func (p *P11) ExportPublicKey(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle, algorithm uint32) ([]byte, error) + func (p *P11) ExportPublicKeyEC(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle) ([]byte, error) + func (p *P11) ExportPublicKeyRSA(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle) ([]byte, error) + func (p *P11) ExportSecretKey(sh pkcs11.SessionHandle, oh pkcs11.ObjectHandle) ([]byte, error) + func (p *P11) Finalize() error + func (p *P11) FindObjects(slotID uint, template []*pkcs11.Attribute) ([]pkcs11.ObjectHandle, error) + func (p *P11) GenerateAESKey(sh pkcs11.SessionHandle, label string, keylength int, ...) (pkcs11.ObjectHandle, error) + func (p *P11) GenerateDESKey(sh pkcs11.SessionHandle, label string, keylength int, ...) (pkcs11.ObjectHandle, error) + func (p *P11) GenerateECKeypair(sh pkcs11.SessionHandle, label string, curve string, ...) (pkcs11.ObjectHandle, error) + func (p *P11) GenerateRSAKeypair(sh pkcs11.SessionHandle, label string, keylength int, ...) (pkcs11.ObjectHandle, pkcs11.ObjectHandle, error) + func (p *P11) GetSlots() (map[uint]pkcs11.TokenInfo, error) + func (p *P11) ImportCertificate(sh pkcs11.SessionHandle, cert *x509.Certificate, label string, ephemeral bool) (pkcs11.ObjectHandle, error) + func (p *P11) ImportPrivateKey(sh pkcs11.SessionHandle, rawKey []byte, keylabel string, ephemeral bool, ...) (pkcs11.ObjectHandle, error) + func (p *P11) ImportPublicKey(sh pkcs11.SessionHandle, pub any, keyLabel string, ephemeral bool) (pkcs11.ObjectHandle, error) + func (p *P11) ImportSecretKey(sh pkcs11.SessionHandle, rawKey []byte, keylabel string, ephemeral bool, ...) (pkcs11.ObjectHandle, error) + func (p *P11) Login(slotID uint, pin string) error + func (p *P11) OpenSession(slotID uint) (pkcs11.SessionHandle, error)