GcrPkcs11Certificate: Gcr Library Reference Manual

## GcrPkcs11Certificate GcrPkcs11Certificate — A certificate loaded from PKCS#11 storage |

## Functions

GcrCertificate * | gcr_pkcs11_certificate_lookup_issuer ()
void | gcr_pkcs11_certificate_lookup_issuer_async ()
GcrCertificate * | gcr_pkcs11_certificate_lookup_issuer_finish ()
GckAttributes * | gcr_pkcs11_certificate_get_attributes ()

## Properties

GckAttributes * | attributes | Read / Write / Construct Only

## Types and Values

struct | GcrPkcs11Certificate
struct | GcrPkcs11CertificateClass

## Object Hierarchy

        GObject
        ╰── GckObject
            ╰── GcrPkcs11Certificate

## Implemented Interfaces

GcrPkcs11Certificate implements GcrComparable and GcrCertificate.

## Description

A GcrPkcs11Certificate is a certificate loaded from a PKCS#11 storage. It is also a valid GckObject and can be used as such.

Use `gcr_pkcs11_certificate_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 `gcr_pkcs11_certificate_get_attributes()`.

## Functions

### gcr_pkcs11_certificate_lookup_issuer ()

    GcrCertificate *
    gcr_pkcs11_certificate_lookup_issuer (GcrCertificate *certificate,
                                          GCancellable *cancellable,
                                          GError **error);

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 `gcr_pkcs11_certificate_lookup_issuer()` for the non-blocking version.

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

#### Parameters

certificate | a GcrCertificate |
cancellable | a GCancellable |
error | a GError, or NULL |

#### Returns

a new GcrPkcs11Certificate, or `NULL`.

[transfer full]

### gcr_pkcs11_certificate_lookup_issuer_async ()

    void
    gcr_pkcs11_certificate_lookup_issuer_async
                                   (GcrCertificate *certificate,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

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 `gcr_pkcs11_certificate_lookup_issuer_finish()` to get the result of the operation.

#### Parameters

certificate | a GcrCertificate |
cancellable | a GCancellable |
callback | a GAsyncReadyCallback to call when the operation completes |
user_data | the data to pass to callback function |

### gcr_pkcs11_certificate_lookup_issuer_finish ()

    GcrCertificate *
    gcr_pkcs11_certificate_lookup_issuer_finish
                                   (GAsyncResult *result,
                                    GError **error);

Finishes an asynchronous operation started by `gcr_pkcs11_certificate_lookup_issuer_async()`.

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

#### Parameters

result | the GAsyncResult passed to the callback |
error | a GError, or NULL |

#### Returns

a new GcrPkcs11Certificate, or `NULL`.

[transfer full]

### gcr_pkcs11_certificate_get_attributes ()

    GckAttributes *
    gcr_pkcs11_certificate_get_attributes (GcrPkcs11Certificate *self);

Access the automatically loaded attributes for this certificate.

#### Parameters

self | A GcrPkcs11Certificate |

#### Returns

the certificate attributes.

[transfer none]

## Types and Values

### struct GcrPkcs11Certificate

    struct GcrPkcs11Certificate;

A certificate loaded from PKCS#11 storage.

### struct GcrPkcs11CertificateClass

    struct GcrPkcs11CertificateClass {
    };

The class for GcrPkcs11Certificate.

## Property Details

### The `“attributes”` property

      “attributes”               GckAttributes *

Automatically loaded attributes for this certificate.

Flags: Read / Write / Construct Only