PrivateKey
Represents a private key.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _key | rsa.RSAPrivateKey | The internal RSA private key object used for signing data and cryptographic operations. |
Constructor
Signature
def PrivateKey(
key: string|bytes,
password: string|bytes = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| key | `string | bytes` |
| password | `string | bytes` = None |
Signature
def PrivateKey(
key: string|bytes,
password: string|bytes = null
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| key | `string | bytes` |
| password | `string | bytes` = null |
Methods
sign()
@classmethod
def sign(
data: string|bytes,
digest: hashes.HashAlgorithm
) - > bytes
Sign string containing data.
Parameters
| Name | Type | Description |
|---|---|---|
| data | `string | bytes` |
| digest | hashes.HashAlgorithm | The cryptographic hash algorithm instance used to compute the message digest and configure the MGF1 mask generation function. |
Returns
| Type | Description |
|---|---|
bytes | The digital signature generated from the input data using RSA-PSS padding. |