cmp.utilΒΆ

This module provides some utility functions regarding CMP.

ClassesΒΆ

PkiMessageType

PKI Message Type (CMP) Enum.

PkiOperation

PKI Management Operation Path Segments (RFC 9483).

GeneralNameType

General Name Type Enum.

Popo

Proof of Possession Enum.

PKIFailureInfo

PKI Failure Info Enum.

NameParser

Provides class methods to transform pyasn1 (General)Names into x509.(General)Names.

Module ContentsΒΆ

class cmp.util.PkiMessageType(*args, **kwds)[source]ΒΆ

Bases: enum.Enum

PKI Message Type (CMP) Enum.

IR = 'ir'[source]ΒΆ
CR = 'cr'[source]ΒΆ
KUR = 'kur'[source]ΒΆ
RR = 'rr'[source]ΒΆ
GENM = 'genm'[source]ΒΆ
class cmp.util.PkiOperation(*args, **kwds)[source]ΒΆ

Bases: enum.Enum

PKI Management Operation Path Segments (RFC 9483).

INITIALIZATION = 'initialization'[source]ΒΆ
CERTIFICATION = 'certification'[source]ΒΆ
KEYUPDATE = 'keyupdate'[source]ΒΆ
PKCS10 = 'pkcs10'[source]ΒΆ
REVOCATION = 'revocation'[source]ΒΆ
GETCACERTS = 'getcacerts'[source]ΒΆ
GETROOTUPDATE = 'getrootupdate'[source]ΒΆ
GETCERTREQTEMPLATE = 'getcertreqtemplate'[source]ΒΆ
GETCRLS = 'getcrls'[source]ΒΆ
NESTED = 'nested'[source]ΒΆ
class cmp.util.GeneralNameType(*args, **kwds)[source]ΒΆ

Bases: enum.Enum

General Name Type Enum.

RFC822_NAME = 'rfc822Name'[source]ΒΆ
DNS_NAME = 'dNSName'[source]ΒΆ
DIRECTORY_NAME = 'directoryName'[source]ΒΆ
UNIFORM_RESOURCE_IDENTIFIER = 'uniformResourceIdentifier'[source]ΒΆ
IP_ADDRESS = 'iPAddress'[source]ΒΆ
REGISTERED_ID = 'registeredID'[source]ΒΆ
OTHER_NAME = 'otherName'[source]ΒΆ
class cmp.util.Popo(*args, **kwds)[source]ΒΆ

Bases: enum.Enum

Proof of Possession Enum.

RA_VERIFIED = 'raVerified'[source]ΒΆ
SIGNATURE = 'signature'[source]ΒΆ
KEY_ENCIPHERMENT = 'keyEncipherment'[source]ΒΆ
KEY_AGREEMENT = 'keyAgreement'[source]ΒΆ
class cmp.util.PKIFailureInfo[source]ΒΆ

Bases: enum.IntEnum

PKI Failure Info Enum.

BAD_ALG = 0[source]ΒΆ
BAD_MESSAGE_CHECK = 1[source]ΒΆ
BAD_REQUEST = 2[source]ΒΆ
BAD_TIME = 3[source]ΒΆ
BAD_CERT_ID = 4[source]ΒΆ
BAD_DATA_FORMAT = 5[source]ΒΆ
WRONG_AUTHORITY = 6[source]ΒΆ
INCORRECT_DATA = 7[source]ΒΆ
MISSING_TIME_STAMP = 8[source]ΒΆ
BAD_POP = 9[source]ΒΆ
CERT_REVOKED = 10[source]ΒΆ
CERT_CONFIRMED = 11[source]ΒΆ
WRONG_INTEGRITY = 12[source]ΒΆ
BAD_RECIPIENT_NONCE = 13[source]ΒΆ
TIME_NOT_AVAILABLE = 14[source]ΒΆ
UNACCEPTED_POLICY = 15[source]ΒΆ
UNACCEPTED_EXTENSION = 16[source]ΒΆ
ADD_INFO_NOT_AVAILABLE = 17[source]ΒΆ
BAD_SENDER_NONCE = 18[source]ΒΆ
BAD_CERT_TEMPLATE = 19[source]ΒΆ
SIGNER_NOT_TRUSTED = 20[source]ΒΆ
TRANSACTION_ID_IN_USE = 21[source]ΒΆ
UNSUPPORTED_VERSION = 22[source]ΒΆ
NOT_AUTHORIZED = 23[source]ΒΆ
SYSTEM_UNAVAIL = 24[source]ΒΆ
SYSTEM_FAILURE = 25[source]ΒΆ
DUPLICATE_CERT_REQ = 26[source]ΒΆ
class cmp.util.NameParser[source]ΒΆ

Provides class methods to transform pyasn1 (General)Names into x509.(General)Names.

classmethod parse_general_name(general_name)[source]ΒΆ

Parses the pyasn1_modules.rfc2459.GeneralName object and transforms it into a x509.GeneralName object.

Parameters:

general_name (pyasn1_modules.rfc2459.GeneralName) – The pyasn1_modules.rfc2459.GeneralName object to parse.

Returns:

The cryptography.x509.Name object.

Return type:

cryptography.x509.GeneralName

static parse_name(name)[source]ΒΆ

Parses the pyasn1_modules.rfc2459.Name object and transforms it into a x509.Name object.

Parameters:

name (pyasn1_modules.rfc2459.Name) – The pyasn1_modules.rfc2459.Name object to parse.

Returns:

The cryptography.x509.Name object.

Return type:

cryptography.x509.Name