Skip to content

Add mechanisms used by Thales Luna HSMs #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkcs11/mechanisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ class Mechanism(IntEnum):
AES_CFB1 = 0x00002108
AES_KEY_WRAP = 0x00002109
AES_KEY_WRAP_PAD = 0x0000210A
AES_KEY_WRAP_KWP = 0x0000210B

DES_ECB_ENCRYPT_DATA = 0x00001100
DES_CBC_ENCRYPT_DATA = 0x00001101
Expand Down Expand Up @@ -708,6 +709,13 @@ class Mechanism(IntEnum):

_VENDOR_DEFINED = 0x80000000

# used by Thales LUNA AES_KWP in cmu importkey
# for importing PKCS#8 to the HSM:
# _VENDOR_DEFINED + 0x170 = CKM_AES_KW
# _VENDOR_DEFINED + 0x171 = CKM_AES_KWP
VENDOR_DEFINED_170 = _VENDOR_DEFINED + 0x170
VENDOR_DEFINED_171 = _VENDOR_DEFINED + 0x171

def __repr__(self):
return '<Mechanism.%s>' % self.name

Expand Down