Utility functions for X509.
| Function | |
Checks the local node daemon certificate against given certificate. |
| Function | |
Extracts the certificate from a PEM-formatted string. |
| Function | |
Legacy function to generate self-signed X509 certificate. |
| Function | |
Generates a self-signed X509 certificate. |
| Function | |
Undocumented |
| Function | |
Generates a signed (but not self-signed) X509 certificate. |
| Function | |
Returns the validity period of the certificate. |
| Function | |
Verifies a signed X509 certificate. |
| Function | |
Sign a X509 certificate. |
| Function | |
Verifies a certificate for LUClusterVerify. |
| Function | |
Function for verifying certificate with a certain private key. |
| Constant | CERT |
Undocumented |
| Constant | CERT |
Undocumented |
| Constant | HEX |
Undocumented |
| Constant | VALID |
Undocumented |
| Constant | X509 |
Undocumented |
| Function | _ |
Helper function to extract signature from X509 certificate. |
| Function | _ |
Parses an ASN1 GENERALIZEDTIME timestamp as used by pyOpenSSL. |
| Function | _ |
Verifies certificate validity. |
| Constant | _ASN1 |
Undocumented |
Checks the local node daemon certificate against given certificate.
Both certificates must be signed with the same key (as stored in the local pathutils.NODED_CERT_FILE file). No error is raised if no local certificate can be found.
| Parameters | |
| cert:OpenSSL.crypto.X509 | X509 certificate object |
| _noded | Undocumented |
| Raises | |
errors.X509CertError | When an error related to X509 occurred |
errors.GenericError | When the verification failed |
Extracts the certificate from a PEM-formatted string.
| Parameters | |
| pem:string | Undocumented |
| Returns | |
| tuple; (OpenSSL.X509 object, string) | Certificate object and PEM-formatted certificate |
Legacy function to generate self-signed X509 certificate.
| Parameters | |
| filename:str | path to write certificate to |
| serial | Undocumented |
| common | commonName value |
| validity:int | validity of certificate in number of days |
| uid:int | the user ID of the user who will be owner of the certificate file |
| gid:int | the group ID of the group who will own the certificate file |
| Returns | |
| a tuple of strings containing the PEM-encoded private key and certificate | |
Generates a self-signed X509 certificate.
| Parameters | |
| common | commonName value |
| validity:int | Validity for certificate in seconds |
| serial | Undocumented |
| Returns | |
| a tuple of strings containing the PEM-encoded private key and certificate | |
Undocumented
Generates a signed (but not self-signed) X509 certificate.
| Parameters | |
| common | commonName value, should be hostname of the machine |
| validity:int | Validity for certificate in seconds |
| serial | Undocumented |
| signing | PEM-encoded private key of the signing certificate |
| Returns | |
| a tuple of strings containing the PEM-encoded private key and certificate | |
Returns the validity period of the certificate.
| Parameters | |
| cert:OpenSSL.crypto.X509 | X509 certificate object |
Verifies a signed X509 certificate.
| Parameters | |
| cert | Certificate in PEM format and with signature header |
| key:string | Key for HMAC |
| Returns | |
| tuple; (OpenSSL.crypto.X509, string) | X509 certificate object and salt |
Sign a X509 certificate.
An RFC822-like signature header is added in front of the certificate.
| Parameters | |
| cert:OpenSSL.crypto.X509 | X509 certificate object |
| key:string | Key for HMAC |
| salt:string | Salt for HMAC |
| Returns | |
| string | Serialized and signed certificate in PEM format |
Verifies a certificate for LUClusterVerify.
| Parameters | |
| cert:OpenSSL.crypto.X509 | X509 certificate object |
| warn | How many days before expiration a warning should be reported |
| error | How many days before expiration an error should be reported |
Function for verifying certificate with a certain private key.
| Parameters | |
| cert:OpenSSL.crypto.X509 | X509 certificate object |
| key:OpenSSL.crypto.PKey | Private key object |
| Returns | |
| callable | Callable doing the actual check; will raise OpenSSL.SSL.Error if certificate is not signed by given private key |
Undocumented
| Value |
|
Parses an ASN1 GENERALIZEDTIME timestamp as used by pyOpenSSL.
| Parameters | |
| value:string or bytes | ASN1 GENERALIZEDTIME timestamp |
| Returns | |
| Seconds since the Epoch (1970-01-01 00:00:00 UTC) | |
Verifies certificate validity.
| Parameters | |
| expired:bool | Whether pyOpenSSL considers the certificate as expired |
| not | Unix timestamp before which certificate is not valid |
| not | Unix timestamp after which certificate is invalid |
| now:number | Current time as Unix timestamp |
| warn | How many days before expiration a warning should be reported |
| error | How many days before expiration an error should be reported |