Pkcs11Certificate#
Superclasses: Object, Object
Implemented Interfaces: Certificate
A certificate loaded from a PKCS``11`` storage.
It is also a valid Object and can be used as such.
Use lookup_issuer to lookup the issuer of a
given certificate in the PKCS``11`` store.
Various common PKCS``11`` certificate attributes are automatically loaded and
are available via get_attributes.
Methods#
- class Pkcs11Certificate
- get_attributes() Attributes#
Access the automatically loaded attributes for this certificate.
- classmethod lookup_issuer(certificate: Certificate, cancellable: Cancellable | None = None) Certificate | None#
Lookup a the issuer of a
certificatein the PKCS``11`` storage. The lookup is done using the issuer DN of the certificate. No certificate chain verification is done. Use a crypto library to make trust decisions.This call may block, see
lookup_issuerfor the non-blocking version.Will return
Noneif no issuer certificate is found. Useerrorto determine if an error occurred.- Parameters:
certificate – a
Certificatecancellable – a cancellable
- classmethod lookup_issuer_async(certificate: Certificate, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
Lookup a the issuer of a
certificatein the PKCS``11`` storage. The lookup is done using the issuer DN of the certificate. No certificate chain verification is done. Use a crypto library to make trust decisions.When the operation is finished, callback will be called. You can then call
lookup_issuer_finishto get the result of the operation.- Parameters:
certificate – a
Certificatecancellable – a cancellable
callback – a
AsyncReadyCallbackto call when the operation completesuser_data – the data to pass to callback function
- classmethod lookup_issuer_finish(result: AsyncResult) Certificate | None#
Finishes an asynchronous operation started by
lookup_issuer_async.Will return
Noneif no issuer certificate is found. Useerrorto determine if an error occurred.- Parameters:
result – the
AsyncResultpassed to the callback
- classmethod new_from_uri(pkcs11_uri: str, cancellable: Cancellable | None = None) Certificate | None#
Lookup a certificate in the PKCS``11`` storage by the given URI.
This call may block, see
new_from_uri_async()for the non-blocking version.Will return
Noneif no certificate is found. Useerrorto determine if an error occurred.- Parameters:
pkcs11_uri – a A PKCS #11 URI
cancellable – a
Cancellable
- classmethod new_from_uri_async(pkcs11_uri: str, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
Lookup a certificate in the PKCS``11`` storage by the given URI.
When the operation is finished, callback will be called. You can then call
new_from_uri_finish()to get the result of the operation.- Parameters:
pkcs11_uri – a A PKCS #11 URI
cancellable – a
Cancellablecallback – a
AsyncReadyCallbackto call when the operation completesuser_data – the data to pass to callback function
- classmethod new_from_uri_finish(result: AsyncResult) Certificate | None#
Finishes an asynchronous operation started by
new_from_uri_async().Will return
Noneif no certificate is found. Useerrorto determine if an error occurred.- Parameters:
result – the
AsyncResultpassed to the callback
Properties#
- class Pkcs11Certificate
- props.attributes: Attributes#
Automatically loaded attributes for this certificate.