NAME
Crypt::HSM::Object - A PKCS11 object
VERSION
version 0.019
SYNOPSIS
my
(
$key
) =
$session
->find_objects({
label
=>
$label
,
encrypt
=> 1 });
if
(not
$key
) {
$key
=
$session
->generate_key(
'aes-key-gen'
, {
label
=>
$label
,
sensitive
=> 1,
"value-len"
=> 32 });
}
$session
->encrypt(
'aes-gcm'
,
$key
,
$plaintext
,
$nonce
);
DESCRIPTION
This class represents an object (usually a key) in the HSM's database. It's returned by Crypt::HSM::Session methods like find_object
and generate_key
, and used in methods such as encrypt
, decrypt
, sign
and verify
.
METHODS
copy_object($attributes)
Copy the object, optionally adding/modifying the given attributes.
destroy_object()
This deletes this object from the slot.
get_attribute($attribute_name)
This returns the value of the named attribute of the object.
get_attributes(\@attribute_list)
This returns a hash with the attributes of the object that are asked for.
object_size()
This returns the size of this object.
set_attributes($attributes)
This sets the $attributes
on this object.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2023 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.