Certificates¶
API¶
Infisical Certificate Resource API.
CertificatesV1
¶
Bases: InfisicalAPI
Infisical Certificates v1 API Resource.
Attributes:
| Name | Type | Description |
|---|---|---|
base_uri |
str
|
|
Source code in src/infisical/resources/certificates/api.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
__init__
¶
Initialize the Infisical Certificates Resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
SyncOrAsyncClient
|
An initialized InfisicalClient or InfisicalAsyncClient. |
required |
Source code in src/infisical/resources/certificates/api.py
delete
¶
delete(*, serial_number: str) -> Certificate
Delete a certificate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serial_number
|
str
|
The serial number of the certificate. |
required |
Source code in src/infisical/resources/certificates/api.py
get_certificate_body_chain
¶
get_certificate_body_chain(*, serial_number: str) -> CertificateBodyChain
Get the certificate body and chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serial_number
|
str
|
The serial number of the certificate. |
required |
Source code in src/infisical/resources/certificates/api.py
get_certificate_bundle
¶
get_certificate_bundle(*, serial_number: str) -> CertificateBundle
Get the certificate bundle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serial_number
|
str
|
The serial number of the certificate. |
required |
Source code in src/infisical/resources/certificates/api.py
get_certificate_private_key
¶
Get the certificate private key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serial_number
|
str
|
The serial number of the certificate. |
required |
Source code in src/infisical/resources/certificates/api.py
issue_certificate
¶
issue_certificate(request: IssueCertificateRequest) -> IssuedCertificate
Issue a new certificate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
IssueCertificateRequest
|
The request object containing the certificate details. |
required |
Source code in src/infisical/resources/certificates/api.py
revoke
¶
revoke(*, serial_number: str, reason: RevocationReasons) -> Revocation
Revoke a certificate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serial_number
|
str
|
The serial number of the certificate. |
required |
reason
|
RevocationReasons
|
The reason for revocation. |
required |
Source code in src/infisical/resources/certificates/api.py
sign_certificate
¶
sign_certificate(csr: SignCertificateRequest) -> SignedCertificate
Sign a certificate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csr
|
SignCertificateRequest
|
The request object containing the CSR details. |
required |
Source code in src/infisical/resources/certificates/api.py
CertificatesV2
¶
Bases: InfisicalAPI
Infisical Certificates v2 API Resource.
Attributes:
| Name | Type | Description |
|---|---|---|
base_uri |
str
|
|
Source code in src/infisical/resources/certificates/api.py
__init__
¶
Initialize the Infisical Certificates Resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
SyncOrAsyncClient
|
An initialized InfisicalClient or InfisicalAsyncClient. |
required |
Source code in src/infisical/resources/certificates/api.py
list
¶
list(
*, slug: str, **params: Unpack[ListCertificatesQueryParams]
) -> CertificatesList
List all certificates in the specified project slug.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slug
|
str
|
The project slug. |
required |
**params
|
ListCertificatesQueryParams
|
Additional query parameters for filtering the list of certificates. |
{}
|
Raises:
| Type | Description |
|---|---|
InfisicalResourceError
|
If required params are missing or invalid. |
Source code in src/infisical/resources/certificates/api.py
Certificates
¶
Infisical Certificates Resource.
Attributes:
| Name | Type | Description |
|---|---|---|
v1 |
CertificatesV1
|
The v1 API resource for certificates. |
v2 |
CertificatesV2
|
The v2 API resource for certificates. |
Source code in src/infisical/resources/certificates/api.py
__init__
¶
Initialize the Infisical Certificates Resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
SyncOrAsyncClient
|
An initialized InfisicalClient or InfisicalAsyncClient. |
required |
Source code in src/infisical/resources/certificates/api.py
Models¶
Infisical Certificate Resource Models.
ListCertificatesQueryParams
¶
Bases: TypedDict
Query parameters for listing certificates.
Theese the available query parameters you can pass to the list method.
Other Parameters:
| Name | Type | Description |
|---|---|---|
limit |
int
|
The maximum number of certificates to return, between |
offset |
int
|
The offset for pagination, between |
commonName |
str
|
The common name of the certificate. |
friendlyName |
str
|
The friendly name of the certificate. |
Source code in src/infisical/resources/certificates/models.py
Certificate
¶
Bases: BaseModel
Certificate model.
Attributes:
| Name | Type | Description |
|---|---|---|
alt_names |
list[str] | str | None
|
Alternative names for the certificate. |
ca_cert_id |
str
|
The ID of the CA certificate. |
ca_id |
str
|
The ID of the CA. |
certificate_id |
str
|
The ID of the certificate. |
certificate_template_id |
str | None
|
The ID of the certificate template. |
common_name |
str
|
The common name for the certificate. |
created_at |
datetime
|
The creation date of the certificate. |
extended_key_usages |
list[str] | None
|
Extended key usages for the certificate. |
friendly_name |
str
|
A friendly name for the certificate. |
key_usages |
list[str] | None
|
Key usages for the certificate. |
not_after |
datetime
|
The expiration date of the certificate. |
not_before |
datetime
|
The start date of the certificate's validity period. |
revocation_reason |
int | None
|
The reason for revocation, if applicable. |
revoked_at |
datetime | None
|
The date when the certificate was revoked, if applicable. |
serial_number |
str
|
The serial number of the certificate. |
status |
str
|
The status of the certificate. |
updated_at |
datetime
|
The last update date of the certificate. |
Source code in src/infisical/resources/certificates/models.py
CertificatesList
¶
Bases: BaseModel
Certificates list model.
Attributes:
| Name | Type | Description |
|---|---|---|
certificates |
list[Certificate]
|
A list of certificates. |
Source code in src/infisical/resources/certificates/models.py
CertificateBodyChain
¶
Bases: BaseModel
Certificate body and chain model.
Attributes:
| Name | Type | Description |
|---|---|---|
certificate_chain |
str | None
|
The certificate chain. |
certificate |
str
|
The certificate. |
serial_number |
str
|
The serial number of the certificate. |
Source code in src/infisical/resources/certificates/models.py
CertificateBundle
¶
Bases: BaseModel
Certificate bundle model.
Attributes:
| Name | Type | Description |
|---|---|---|
certificate_chain |
str | None
|
The certificate chain. |
certificate |
str
|
The certificate. |
private_key |
str
|
The private key. |
serial_number |
str
|
The serial number of the certificate. |
Source code in src/infisical/resources/certificates/models.py
Revocation
¶
Bases: BaseModel
Revocation model.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
The revocation message. |
revoked_at |
datetime
|
The date when the certificate was revoked. |
serial_number |
str
|
The serial number of the certificate. |
Source code in src/infisical/resources/certificates/models.py
IssueCertificateRequest
¶
Bases: InfisicalResourceRequest
Issue certificate request model.
The following are required when creating a new request
ca_idcommon_namefriendly_namettlworkspace_idenvironment
Attributes:
| Name | Type | Description |
|---|---|---|
alt_names |
list[str] | None
|
Alternative names for the certificate. |
ca_id |
str
|
The ID of the CA. |
certificate_template_id |
str | None
|
The ID of the certificate template. |
common_name |
str
|
The common name for the certificate. |
extended_key_usages |
list[ExtendedKeyUsages] | None
|
Extended key usages for the certificate. |
friendly_name |
str
|
A friendly name for the certificate. |
key_usages |
list[KeyUsages] | None
|
Key usages for the certificate. |
not_after |
datetime | None
|
The expiration date of the certificate. |
not_before |
datetime | None
|
The start date of the certificate's validity period. |
pki_collection_id |
str | None
|
The ID of the PKI collection. |
ttl |
str
|
The time-to-live for the certificate. |
workspace_id |
str
|
The ID of the workspace. |
environment |
str
|
The environment for the certificate. |
Source code in src/infisical/resources/certificates/models.py
SignCertificateRequest
¶
Bases: InfisicalResourceRequest
Sign certificate request model.
The following are required when creating a new request
ca_idcommon_namecsrfriendly_namettlworkspace_idenvironment
Attributes:
| Name | Type | Description |
|---|---|---|
alt_names |
list[str] | None
|
Alternative names for the certificate. |
ca_id |
str
|
The ID of the CA. |
certificate_template_id |
str | None
|
The ID of the certificate template. |
common_name |
str
|
The common name for the certificate. |
csr |
str
|
The Certificate Signing Request (CSR). |
extended_key_usages |
list[ExtendedKeyUsages] | None
|
Extended key usages for the certificate. |
friendly_name |
str
|
A friendly name for the certificate. |
key_usages |
list[KeyUsages] | None
|
Key usages for the certificate. |
not_after |
datetime | None
|
The expiration date of the certificate. |
not_before |
datetime | None
|
The start date of the certificate's validity period. |
pki_collection_id |
str | None
|
The ID of the PKI collection. |
ttl |
str
|
The time-to-live for the certificate. |
workspace_id |
str
|
The ID of the workspace. |
environment |
str
|
The environment for the certificate. |
Source code in src/infisical/resources/certificates/models.py
SignedCertificate
¶
Bases: BaseModel
Signed certificate model.
Attributes:
| Name | Type | Description |
|---|---|---|
certificate_chain |
str
|
The certificate chain. |
certificate |
str
|
The certificate. |
issuing_ca_certificate |
str
|
The issuing CA certificate. |
serial_number |
str
|
The serial number of the certificate. |
Source code in src/infisical/resources/certificates/models.py
IssuedCertificate
¶
Bases: SignedCertificate
Issued certificate model.
It subclasses SignedCertificate because the attributes are the same
except this one also returns the private_key.
Attributes:
| Name | Type | Description |
|---|---|---|
certificate_chain |
str
|
The certificate chain. |
certificate |
str
|
The certificate. |
issuing_ca_certificate |
str
|
The issuing CA certificate. |
private_key |
str
|
The private key. |
serial_number |
str
|
The serial number of the certificate. |