Pkcs11Certificate#

class Pkcs11Certificate(**properties: Any)#

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(cancellable: Cancellable | None = None) Certificate#

Lookup a the issuer of a certificate in 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_issuer() for the non-blocking version.

Will return None if no issuer certificate is found. Use error to determine if an error occurred.

Parameters:

cancellable – a Cancellable

classmethod lookup_issuer_async(cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#

Lookup a the issuer of a certificate in 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_finish() to get the result of the operation.

Parameters:
  • cancellable – a Cancellable

  • callback – a AsyncReadyCallback to call when the operation completes

  • user_data – the data to pass to callback function

classmethod lookup_issuer_finish() Certificate#

Finishes an asynchronous operation started by lookup_issuer_async().

Will return None if no issuer certificate is found. Use error to determine if an error occurred.

classmethod new_from_uri(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 None if no certificate is found. Use error to determine if an error occurred.

Parameters:

cancellable – a Cancellable

classmethod new_from_uri_async(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:
  • cancellable – a Cancellable

  • callback – a AsyncReadyCallback to call when the operation completes

  • user_data – the data to pass to callback function

classmethod new_from_uri_finish() Certificate | None#

Finishes an asynchronous operation started by new_from_uri_async().

Will return None if no certificate is found. Use error to determine if an error occurred.

Properties#

class Pkcs11Certificate
props.attributes: Attributes#

The type of the None singleton.

Fields#

class Pkcs11Certificate
parent#
pv#