ECDSAPadding

Bases: Padding

Represents ECDSA padding.

Attributes:
  • algorithm (HashAlgorithm) –

    The hash algorithm.

  • prehashed (bool) –

    Indicates if the data is prehashed.

from_cryptography classmethod
from_cryptography(crypto_obj: ec.ECDSA) -> ECDSAPadding

Constructs an ECDSAPadding object from a cryptography ECDSA object.

Parameters:
  • crypto_obj (ec.ECDSA) –

    The cryptography ECDSA object.

Returns:

HashAlgorithm

Bases: CryptoParser

Represents a hash algorithm.

Attributes:
  • name (HashAlgorithmName) –

    The name of the hash algorithm.

  • block_size (Optional[int]) –

    The block size of the hash algorithm.

from_cryptography classmethod
from_cryptography(x509_obj: hashes.HashAlgorithm) -> HashAlgorithm

Constructs a HashAlgorithm object from a cryptography HashAlgorithm object.

Parameters:
Returns:

HashAlgorithmName

Bases: Enum

Enumeration of hash algorithm names.

PKCS1v15Padding

Bases: Padding

Represents PKCS1v15 padding.

from_cryptography classmethod
from_cryptography(crypto_obj: padding.PKCS1v15) -> PKCS1v15Padding

Constructs a PKCS1v15Padding object from a cryptography PKCS1v15 object.

Parameters:
Returns:

PSSPadding

Bases: Padding

Represents PSS padding.

Attributes:
from_cryptography classmethod
from_cryptography(crypto_obj: padding.PSS) -> PSSPadding

Constructs a PSSPadding object from a cryptography PSS object.

Parameters:
  • crypto_obj (padding.PSS) –

    The cryptography PSS object.

Returns:
  • PSSPadding

    The constructed PSSPadding object.

PSSPaddingLenght

Bases: Enum

Enumeration of PSS padding lengths.

Padding

Bases: CryptoParser, ABC

Abstract base class representing padding.

SignatureAlgorithm

Bases: BaseModel

Represents a signature algorithm.

Attributes:
from_cryptography classmethod
from_cryptography(algorithm: hashes.HashAlgorithm, parameters: Union[padding.PSS, padding.PKCS1v15, ec.ECDSA] = None) -> SignatureAlgorithm

Constructs a SignatureAlgorithm object from cryptography objects.

Parameters:
Returns: