Versions in this module Expand all Collapse all v1 v1.1.1 Feb 26, 2024 v1.1.0 Feb 26, 2024 v1.0.5 Dec 6, 2023 v1.0.3 Dec 5, 2023 Changes in this version + const CKM_NCIPHER + const CKM_NC_MD5_HMAC_KEY_GEN + const CKM_NC_SHA224_HMAC_KEY_GEN + const CKM_NC_SHA256_HMAC_KEY_GEN + const CKM_NC_SHA384_HMAC_KEY_GEN + const CKM_NC_SHA512_HMAC_KEY_GEN + const CKM_NC_SHA_1_HMAC_KEY_GEN + const CkaAcIssuer + const CkaAllowedMechanisms + const CkaAlwaysAuthenticate + const CkaAlwaysSensitive + const CkaApplication + const CkaAttrTypes + const CkaAuthPinFlags + const CkaBase + const CkaBitsPerPixel + const CkaCertificateCategory + const CkaCertificateType + const CkaCharColumns + const CkaCharRows + const CkaCharSets + const CkaCheckValue + const CkaClass + const CkaCoefficient + const CkaColor + const CkaCopyable + const CkaDecrypt + const CkaDefaultCmsAttributes + const CkaDerive + const CkaDestroyable + const CkaEcParams + const CkaEcPoint + const CkaEcdsaParams + const CkaEncodingMethods + const CkaEncrypt + const CkaEndDate + const CkaExponent1 + const CkaExponent2 + const CkaExtractable + const CkaGOST28147Params + const CkaGOSTR3410Params + const CkaGOSTR3411Params + const CkaHasReset + const CkaHashOfIssuerPublicKey + const CkaHashOfSubjectPublicKey + const CkaHwFeatureType + const CkaId + const CkaIssuer + const CkaJavaMIDPSecurityDomain + const CkaKeyGenMechanism + const CkaKeyType + const CkaLabel + const CkaLocal + const CkaMechanismType + const CkaMimeTypes + const CkaModifiable + const CkaModulus + const CkaModulusBits + const CkaNameHashAlgorithm + const CkaNeverExtractable + const CkaObjectId + const CkaOtpChallengeRequirement + const CkaOtpCounter + const CkaOtpCounterRequirement + const CkaOtpFormat + const CkaOtpLength + const CkaOtpPinRequirement + const CkaOtpServiceIdentifier + const CkaOtpServiceLogo + const CkaOtpServiceLogoType + const CkaOtpTime + const CkaOtpTimeInterval + const CkaOtpTimeRequirement + const CkaOtpUserFriendlyMode + const CkaOtpUserIdentifier + const CkaOwner + const CkaPixelX + const CkaPixelY + const CkaPrime + const CkaPrime1 + const CkaPrime2 + const CkaPrimeBits + const CkaPrivate + const CkaPrivateExponent + const CkaPublicExponent + const CkaPublicKeyInfo + const CkaRequiredCmsAttributes + const CkaResetOnInit + const CkaResolution + const CkaSecondaryAuth + const CkaSensitive + const CkaSerialNumber + const CkaSign + const CkaSignRecover + const CkaStartDate + const CkaSubPrimeBits + const CkaSubject + const CkaSubprime + const CkaSubprimeBits + const CkaSupportedCmsAttributes + const CkaToken + const CkaTrusted + const CkaUnwrap + const CkaUnwrapTemplate + const CkaUrl + const CkaValue + const CkaValueBits + const CkaValueLen + const CkaVerify + const CkaVerifyRecover + const CkaWrap + const CkaWrapTemplate + const CkaWrapWithTrusted + const CryptoUser + const DefaultGCMIVLength + const DefaultMaxSessions + const DefaultUserType + const NFCK_VENDOR_NCIPHER + var CipherAES = &SymmetricCipher + var CipherDES3 = &SymmetricCipher + var CipherGeneric = &SymmetricCipher + var CipherHMACSHA1 = &SymmetricCipher + var CipherHMACSHA224 = &SymmetricCipher + var CipherHMACSHA256 = &SymmetricCipher + var CipherHMACSHA384 = &SymmetricCipher + var CipherHMACSHA512 = &SymmetricCipher + var Ciphers = map[int]*SymmetricCipher + type Attribute = pkcs11.Attribute + func CopyAttribute(a *Attribute) *Attribute + func NewAttribute(attributeType AttributeType, value interface{}) (a *Attribute, err error) + type AttributeSet map[AttributeType]*Attribute + func NewAttributeSet() AttributeSet + func NewAttributeSetWithID(id []byte) (AttributeSet, error) + func NewAttributeSetWithIDAndLabel(id, label []byte) (a AttributeSet, err error) + func (a AttributeSet) AddIfNotPresent(additional []*Attribute) + func (a AttributeSet) Copy() AttributeSet + func (a AttributeSet) Set(attributeType AttributeType, value interface{}) error + func (a AttributeSet) String() string + func (a AttributeSet) ToSlice() []*Attribute + func (a AttributeSet) Unset(attributeType AttributeType) + type AttributeType = uint + type BlockModeCloser interface + Close func() + type Config struct + GCMIVFromHSMControl GCMIVFromHSMConfig + GCMIVLength int + Log *log.Logger + LoginNotSupported bool + MaxSessions int + Path string + Pin string + PoolWaitTimeout time.Duration + SlotNumber *int + TokenLabel string + TokenSerial string + UseGCMIVFromHSM bool + UserType int + type Context struct + func Configure(config *Config) (*Context, error) + func ConfigureFromFile(configLocation string) (*Context, error) + func (c *Context) Close() error + func (c *Context) DeleteCertificate(id []byte, label []byte, serial *big.Int) error + func (c *Context) FindAllKeyPairs() ([]Signer, error) + func (c *Context) FindAllKeys() ([]*SecretKey, error) + func (c *Context) FindAllPairedCertificates() (certificates []tls.Certificate, err error) + func (c *Context) FindCertificate(id []byte, label []byte, serial *big.Int) (*x509.Certificate, error) + func (c *Context) FindKey(id []byte, label []byte) (*SecretKey, error) + func (c *Context) FindKeyPair(id []byte, label []byte) (Signer, error) + func (c *Context) FindKeyPairWithAttributes(attributes AttributeSet) (Signer, error) + func (c *Context) FindKeyPairs(id []byte, label []byte) (signer []Signer, err error) + func (c *Context) FindKeyPairsWithAttributes(attributes AttributeSet) (signer []Signer, err error) + func (c *Context) FindKeyWithAttributes(attributes AttributeSet) (*SecretKey, error) + func (c *Context) FindKeys(id []byte, label []byte) (key []*SecretKey, err error) + func (c *Context) FindKeysWithAttributes(attributes AttributeSet) ([]*SecretKey, error) + func (c *Context) GenerateDSAKeyPair(id []byte, params *dsa.Parameters) (Signer, error) + func (c *Context) GenerateDSAKeyPairWithAttributes(public, private AttributeSet, params *dsa.Parameters) (Signer, error) + func (c *Context) GenerateDSAKeyPairWithLabel(id, label []byte, params *dsa.Parameters) (Signer, error) + func (c *Context) GenerateECDSAKeyPair(id []byte, curve elliptic.Curve) (Signer, error) + func (c *Context) GenerateECDSAKeyPairWithAttributes(public, private AttributeSet, curve elliptic.Curve) (Signer, error) + func (c *Context) GenerateECDSAKeyPairWithLabel(id, label []byte, curve elliptic.Curve) (Signer, error) + func (c *Context) GenerateRSAKeyPair(id []byte, bits int) (SignerDecrypter, error) + func (c *Context) GenerateRSAKeyPairWithAttributes(public, private AttributeSet, bits int) (SignerDecrypter, error) + func (c *Context) GenerateRSAKeyPairWithLabel(id, label []byte, bits int) (SignerDecrypter, error) + func (c *Context) GenerateSecretKey(id []byte, bits int, cipher *SymmetricCipher) (*SecretKey, error) + func (c *Context) GenerateSecretKeyWithAttributes(template AttributeSet, bits int, cipher *SymmetricCipher) (k *SecretKey, err error) + func (c *Context) GenerateSecretKeyWithLabel(id, label []byte, bits int, cipher *SymmetricCipher) (*SecretKey, error) + func (c *Context) GetAttribute(key interface{}, attribute AttributeType) (a *Attribute, err error) + func (c *Context) GetAttributes(key interface{}, attributes []AttributeType) (a AttributeSet, err error) + func (c *Context) GetPubAttribute(key interface{}, attribute AttributeType) (a *Attribute, err error) + func (c *Context) GetPubAttributes(key interface{}, attributes []AttributeType) (a AttributeSet, err error) + func (c *Context) ImportCertificate(id []byte, certificate *x509.Certificate) error + func (c *Context) ImportCertificateWithAttributes(template AttributeSet, certificate *x509.Certificate) error + func (c *Context) ImportCertificateWithLabel(id []byte, label []byte, certificate *x509.Certificate) error + func (c *Context) NewRandomReader() (io.Reader, error) + type GCMIVFromHSMConfig struct + SupplyIvForHSMGCMDecrypt bool + SupplyIvForHSMGCMEncrypt bool + type PaddingMode int + const PaddingNone + const PaddingPKCS + type SecretKey struct + Cipher *SymmetricCipher + func (key *SecretKey) BlockSize() int + func (key *SecretKey) Decrypt(dst, src []byte) + func (key *SecretKey) Delete() error + func (key *SecretKey) Encrypt(dst, src []byte) + func (key *SecretKey) NewCBC(paddingMode PaddingMode) (cipher.AEAD, error) + func (key *SecretKey) NewCBCDecrypter(iv []byte) (cipher.BlockMode, error) + func (key *SecretKey) NewCBCDecrypterCloser(iv []byte) (BlockModeCloser, error) + func (key *SecretKey) NewCBCEncrypter(iv []byte) (cipher.BlockMode, error) + func (key *SecretKey) NewCBCEncrypterCloser(iv []byte) (BlockModeCloser, error) + func (key *SecretKey) NewGCM() (cipher.AEAD, error) + func (key *SecretKey) NewHMAC(mech int, length int) (hash.Hash, error) + type Signer interface + Delete func() error + type SignerDecrypter interface + Decrypt func(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) + type SymmetricCipher struct + BlockSize int + CBCMech uint + CBCPKCSMech uint + ECBMech uint + Encrypt bool + GCMMech uint + GenParams []SymmetricGenParams + MAC bool + type SymmetricGenParams struct + GenMech uint + KeyType uint