![]() |
![]() |
![]() |
Gcr Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
GcrCertificateRequest; enum GcrCertificateRequestFormat; gboolean gcr_certificate_request_capable (GckObject *private_key
,GCancellable *cancellable
,GError **error
); void gcr_certificate_request_capable_async (GckObject *private_key
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gcr_certificate_request_capable_finish (GAsyncResult *result
,GError **error
); GcrCertificateRequest * gcr_certificate_request_prepare (GcrCertificateRequestFormat format
,GckObject *private_key
); GcrCertificateRequestFormat gcr_certificate_request_get_format (GcrCertificateRequest *self
); GckObject * gcr_certificate_request_get_private_key (GcrCertificateRequest *self
); void gcr_certificate_request_set_cn (GcrCertificateRequest *self
,const gchar *cn
); gboolean gcr_certificate_request_complete (GcrCertificateRequest *self
,GCancellable *cancellable
,GError **error
); void gcr_certificate_request_complete_async (GcrCertificateRequest *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gcr_certificate_request_complete_finish (GcrCertificateRequest *self
,GAsyncResult *result
,GError **error
); guchar * gcr_certificate_request_encode (GcrCertificateRequest *self
,gboolean textual
,gsize *length
);
This is an object that allows creation of certificate requests. A certificate request is sent to a certificate authority to request an X.509 certificate.
Use gcr_certificate_request_prepare()
to create a blank certificate
request for a given private key. Set the common name on the certificate
request with gcr_certificate_request_set_cn()
, and then sign the request
with gcr_certificate_request_complete_async()
.
typedef struct _GcrCertificateRequest GcrCertificateRequest;
Represents a certificate request.
typedef enum { GCR_CERTIFICATE_REQUEST_PKCS10 = 1, } GcrCertificateRequestFormat;
The format of a certificate request. Currently only PKCS#10 is supported.
gboolean gcr_certificate_request_capable (GckObject *private_key
,GCancellable *cancellable
,GError **error
);
Check whether GcrCertificateRequest is capable of creating a request
for the given private_key
.
|
a private key |
|
cancellation object |
|
location to place an error |
Returns : |
whether a request can be created |
void gcr_certificate_request_capable_async (GckObject *private_key
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously check whether GcrCertificateRequest is capable of creating
a request for the given private_key
.
|
a private key |
|
cancellation object |
|
will be called when the operation completes |
|
data to be passed to callback |
gboolean gcr_certificate_request_capable_finish (GAsyncResult *result
,GError **error
);
Get the result for asynchronously check whether GcrCertificateRequest is
capable of creating a request for the given private_key
.
|
asynchronous result |
|
location to place an error |
Returns : |
whether a request can be created |
GcrCertificateRequest * gcr_certificate_request_prepare (GcrCertificateRequestFormat format
,GckObject *private_key
);
Create a new certificate request, in the given format for the private key.
|
the format for the certificate request |
|
the private key the the certificate is being requested for |
Returns : |
a new GcrCertificate request. [transfer full] |
GcrCertificateRequestFormat gcr_certificate_request_get_format
(GcrCertificateRequest *self
);
Get the format of this certificate request.
|
the certificate request |
Returns : |
the format |
GckObject * gcr_certificate_request_get_private_key
(GcrCertificateRequest *self
);
Get the private key this certificate request is for.
|
the certificate request |
Returns : |
the private key,. [transfer none] |
void gcr_certificate_request_set_cn (GcrCertificateRequest *self
,const gchar *cn
);
Set the common name encoded in the certificate request.
|
the certificate request |
|
common name to set on the request |
gboolean gcr_certificate_request_complete (GcrCertificateRequest *self
,GCancellable *cancellable
,GError **error
);
Complete and sign a certificate request, so that it can be encoded and sent to a certificate authority.
This call may block as it signs the request using the private key.
|
a certificate request |
|
a cancellation object |
|
location to place an error on failure |
Returns : |
whether certificate request was successfully completed or not |
void gcr_certificate_request_complete_async (GcrCertificateRequest *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously complete and sign a certificate request, so that it can be encoded and sent to a certificate authority.
This call will return immediately and complete later.
|
a certificate request |
|
a cancellation object |
|
called when the operation completes |
|
data to pass to the callback |
gboolean gcr_certificate_request_complete_finish (GcrCertificateRequest *self
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation to complete and sign a certificate request.
|
a certificate request |
|
result of the asynchronous operation |
|
location to place an error on failure |
Returns : |
whether certificate request was successfully completed or not |
guchar * gcr_certificate_request_encode (GcrCertificateRequest *self
,gboolean textual
,gsize *length
);
Encode the certificate request. It must have been completed with
gcr_certificate_request_complete()
or gcr_certificate_request_complete_async()
If textual
is FALSE
, the output is a DER encoded certificate request.
If textual
is TRUE
, the output is encoded as text. For PKCS#10 requests this
is done using the OpenSSL style PEM encoding.
|
a certificate request |
|
whether to encode output as text |
|
location to place length of returned data |
Returns : |
the encoded certificate request. [transfer full][array length=length] |