bit-and bit-lshift bit-or bit-rshift close-all-sessions close-session copy-object create-object decrypt decrypt-digest-update decrypt-final decrypt-init decrypt-update decrypt-verify-update derive-key destroy-object digest digest-encrypt-update digest-final digest-init digest-key digest-update encrypt encrypt-final encrypt-init encrypt-update find-objects find-objects-final find-objects-init generate-key generate-key-pair generate-random get-attribute-value get-info get-mechanism-info get-mechanism-list get-object-size get-operation-state get-session-info get-slot-info get-slot-list get-token-info hex-decode hex-encode init-pin init-token login logout new open-session seed-random set-attribute-value set-pin sign sign-encrypt-update sign-final sign-init sign-recover sign-recover-init sign-update unwrap-key verify verify-final verify-init verify-recover verify-recover-init verify-update wait-for-slot-event wrap-key
(bit-and & xs)
Returns the bit-wise and of 64 bit integer xs.
(bit-lshift x shift)
Returns the value of `x` bit shifted left by `shift`. Each elements are 64 bit integers.
(bit-or & xs)
Returns the bit-wise or of 64 bit integer xs.
(bit-rshift x shift)
Returns the value of `x` bit shifted right by `shift`. Each elements are 64 bit integers.
(close-all-sessions p11-obj slot-id)
Closes all sessions an application has with a token.
(close-session session-obj)
Closes a session between an application and a token.
(copy-object session-obj obj-handle template)
Copies an object. Returns new `obj-handle`(number), if successful.
(create-object session-obj template)
Creates a new object. Returns `obj-handle`(number), if successful.
(decrypt session-obj data)
Decrypts encrypted data in a single part. Returns an decrypted data in string, if successful.
(decrypt-digest-update session-obj data)
continues a multiple-part combined decryption and digest operation, processing another data part. Returns a recovered data in string, if successful.
(decrypt-final session-obj)
Finishes a multiple-part decryption operation. Return the last recovered data part in string, if successful.
(decrypt-init session-obj mechanism key-handle)
Initializes an decryption operation. Returns a `session-obj`, if successful.
(decrypt-update session-obj data)
Continues a multiple-part decryption operation, processing another encrypted `data` part. Return the decrypted data part in string, if successful.
(decrypt-verify-update session-obj data)
continues a multiple-part combined decryption and verification operation, processing another data part. Returns a recovered data in string, if successful.
(derive-key session-obj mechanism base-key-handle template)
Derives a key from a base key, creating a new key object. Returns a `key-handle`, if successful.
(destory-object session-obj obj-handle)
Destroys an object.
(digest session-obj data)
Digests data in a single part. Returns an message digest in string, if successful.
(digest-encrypt-update session-obj data)
Continues multiple-part digest and encryption operations, processing another data part. Returns an encrypted data in string, if successful.
(digest-final session-obj)
Finishes a multiple-part message-digesting operation. Return the message digest in string, if successful.
(digest-init session-obj mechanism)
Initializes a message-digesting operation. Returns a `session-obj`, if successful.
(digest-key session-obj key-handle)
Continues a multiple-part message-digesting operation by digesting the value of a secret key. Returns a `session-obj`, if successful.
(digest-update session-obj data)
Continues a multiple-part message-digesting operation, processing another `data` part. Returns a `session-obj`, if successful.
(encrypt session-obj data)
Encrypts single-part data. Returns an encrypted data in string, if successful.
(encrypt-final session-obj)
Finishes a multiple-part encryption operation. Return the last encrypted data part in string, if successful.
(encrypt-init session-obj mechanism key-handle)
Initializes an encryption operation. Returns a `session-obj`, if successful.
(encrypt-update session-obj data)
Continues a multiple-part encryption operation, processing another `data` part. Return the encrypted data part in string, if successful.
(find-objects session-obj max-obj-count)
Continues a search for token and session objects that match a `template`. Returns a list of `obj-handle`, if successful.
(find-objects-final session-obj)
Terminates a search for token and session objects. Returns a `session-obj`, if successful.
(find-objects-init session-obj &opt template)
Initializes a search for token and session objects that match a `template`. Find all objects if `template` is not provided. Returns a `session-obj`, if successful.
(generate-key session-obj mechanism &opt template)
Generates a secret key or set of domain parameters, creating a new key object. Returns a `key-handle`, if successful.
(generate-key-pair session-obj mechanism pubkey-template privkey-template)
Generates a public/private key pair, creating new key objects. Returns a list of [pubkey-handle privkey-handle], if successful.
(generate-random session-obj length)
Generates random or pseudo-random data. Returns the `length` bytes of random data in string format, if successful.
(get-attribute-value session-obj obj-handle attr-list)
Obtains the value of one or more attributes of an object. Returns a template struct, if successful.
(get-info p11-obj)
Returns general information about Cryptoki.
(get-mechanism-info p11-obj slot-id &opt mechanism-list)
Returns a list of mechanisms information of `mechanism-list` list.`slot-id` is the ID of the token’s slot. If `mechanism-list` is not provided, return list of all avaiable mechanism information.
(get-mechanism-list p11-obj slot-id)
Returns a list of mechanisms supported by a token.`slot-id` is the ID of the token’s slot.
(get-object-size session-obj obj-handle)
Returns the size of an object in bytes
(get-operation-state session-obj)
Returns the cryptographic operations state of a session in string.
(get-session-info session-obj)
Returns an information about a session.
(get-slot-info p11-obj &opt slot-id)
Returns information about a particular slot in the system. If `slot-id` is not provided, information about all slots is returned as a list. If there is no slot corresponding to `slot-id` or no slot exists in system, `nil` is returned.
(get-slot-list p11-obj)
Returns a list of slots in the system
(get-token-info p11-obj slot-id)
Returns information about a particular token in the system. `slot-id` is the ID of the token’s slot.
(hex-decode str)
Performs hex decoding of string data in `str`. Returns the string.
(hex-encode bin)
Performs hex encoding of binary data in `bin`. Returns the string.
(init-pin session-obj pin)
Initializes the normal user’s PIN. Returns `session-obj`, if successful.
(init-token p11-obj slot-id so-pin label)
Initializes a token. Return `p11-obj`, if successful.
(login session-obj user-type pin)
Logs a user into a token. `user-type` must be one of the following: :so, :user, or :context-specific. Returns `session-obj`, if successful.
(logout session-obj)
Logs a user out from a token. Returns `session-obj`, if successful.
(new lib-path)
Get the `p11-obj`(an instance holding a handle to the opened PKCS#11 library).
(open-session p11-obj slot-id &opt :read-only)
Opens a session between an application and a token in a particular slot. Opens R/W session unless `:read-only` is passed. Returns `session-obj`, if successful.
(seed-random session-obj seed)
Mixes additional seed material into the token’s random number generator.Returns a `session-obj`, if successful.
(set-attribute-value session-obj obj-handle template)
Modifies the value of one or more attributes of an object. Returns a `session-obj`, if successful.
(set-pin session-obj old-pin new-pin)
Modifies the PIN of the user that is currently logged in, or the normal user's' PIN if the session is not logged in. Returns `session-obj`, if successful.
(sign session-obj data)
Signs data in a single part. Returns a signature of the data in string, if successful.
(sign-encrypt-update session-obj data)
Continues multiple-part combined signature and encryption operations, processing another data part. Returns an encrypted data in string, if successful.
(sign-final session-obj)
Finishes a multiple-part signature operation. Return a signature of the data in string, if successful.
(sign-init session-obj mechanism key-handle)
Initializes a signature operation. Returns a `session-obj`, if successful.
(sign-recover session-obj data)
Signs data in a single operation, where the data can be recovered from the signature. Returns a signature of the data in string, if successful.
(sign-recover-init session-obj mechanism key-handle)
Initializes a signature operation, where the data can be recovered from the signature. Returns a `session-obj`, if successful.
(sign-update session-obj data)
Continues a multiple-part signature operation, processing another `data` part. Returns a `session-obj`, if successful.
(unwrap-key session-obj mechanism unwrapping-key-handle wrapped-key template)
Unwraps (i.e. decrypts) a wrapped key, creating a new private key or secret key object. Returns a `key-handle`, if successful.
(verify session-obj data signature)
Verifies a signature in a single-part operation. Returns a boolean, if successful.
(verify-final session-obj signature)
Finishes a multiple-part verification operation, checking the signature. Returns a boolean, if successful.
(verify-init session-obj mechanism key-handle)
Initializes a verification operation. Returns a `session-obj`, if successful.
(verify-recover session-obj signature)
Verifies a signature in a single-part operation, where the data is recovered from the signature. If successful, resturns tuple of [boolean string], where string is a recovered data.
(verify-recover-init session-obj mechanism key-handle)
Initializes a signature verification operation, where the data is recovered from the signature. Returns a `session-obj`, if successful.
(verify-update session-obj data)
Continues a multiple-part verification operation, processing another `data` part. Returns a `session-obj`, if successful.
(wait-for-slot-event p11-obj)
Returns a list of slot-id of slots where events occurred. Returns `nil` if there are no event in any slots.
(wrap-key session-obj mechanism wrapping-key-handle key-handle)
Wraps (i.e., encrypts) a private or secret key.Returns a wrapped key in string, if successful.