• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.2.0.83
GDCredential.h File Reference
#include "GDCommon.h"
#include <time.h>

Classes

struct  GDX509Certificate
 X.509 Public Key Certificate. More...
 
struct  GDCredential
 

Functions

struct GDX509CertificateGDX509Certificate_create (const struct GDX509 *certificate)
 Create a certificate. More...
 
void GDX509Certificate_free (struct GDX509Certificate *certificate)
 Free a certificate. More...
 
int GDX509Certificate_days_until_expiry (const struct GDX509Certificate *certificate)
 Days until the certificate expires. More...
 
int GDX509Certificate_days_until_renewal_due (const struct GDX509Certificate *certificate)
 Days until the certificate is due for renewal. More...
 
const char * GDX509Certificate_issuer_relative_name (const struct GDX509Certificate *certificate, const char *relative_name)
 Return relative name from within a fully-qualified distinguished name of the issuer. More...
 
const char * GDX509Certificate_subject_relative_name (const struct GDX509Certificate *certificate, const char *relative_name)
 Return relative name from within a fully-qualified distinguished name of the subject. More...
 
bool GDCredential_import (char **profileId, const struct GDData *credential, const char *password, struct GDError *error)
 Import electronic certificate credentials from a PKCS #12 file. More...
 
void GDCredential_importDone (void)
 Finalize credential import. More...
 
bool GDCredential_undoImport (const char *profileId)
 Remove all credentials for a given User Credential Profile. More...
 
struct GDCredentialGDCredential_find (const char *issuer, const char *serial)
 Find a credential. More...
 
bool GDCredential_remove_credential (const struct GDCredential *credential)
 Remove an imported or device credential. More...
 
bool GDCredential_remove (const char *issuer, const char *serial)
 Remove an imported or device credential. More...
 
bool GDCredential_list (const char *profileId, size_t *credentialCount, struct GDCredential **credentials, struct GDError *error)
 List available credentials for a User Credential Profile. More...
 
void GDCredential_free (struct GDCredential *credentials, size_t credentialCount)
 Free a returned credentials buffer. More...
 

Function Documentation

◆ GDX509Certificate_create()

struct GDX509Certificate* GDX509Certificate_create ( const struct GDX509 *  certificate)

Call this function to create a certificate from an opaque GDX509 structure. See GDX509List_value().

Parameters
certificateto create.
Returns
GDX509Certificate if creation succeeded.
NULL otherwise.

◆ GDX509Certificate_free()

void GDX509Certificate_free ( struct GDX509Certificate certificate)

Call this function to release a certificate created by GDX509Certificate_create.

Parameters
certificateto release.

◆ GDX509Certificate_days_until_expiry()

int GDX509Certificate_days_until_expiry ( const struct GDX509Certificate certificate)

Call this function to calculate the number of days until the certificate expires.

Parameters
certificateof interest.
Returns
int days remaining before expiry. A negative value indicates days since the certificate has expired.

◆ GDX509Certificate_days_until_renewal_due()

int GDX509Certificate_days_until_renewal_due ( const struct GDX509Certificate certificate)

Call this function to calculate the number of days until the certificate becomes due for renewal. The renewal date is not part of the X509 certificate and is fixed to 30 days before expiry.

Parameters
certificateof interest.
Returns
int days remaining until due. A negative value indicates the number of days overdue.

◆ GDX509Certificate_issuer_relative_name()

const char* GDX509Certificate_issuer_relative_name ( const struct GDX509Certificate certificate,
const char *  relative_name 
)

Call this function to extract the relative name from within the issuer's fully-qualified distinguished name. For example, to extract the Common Name 'DoD EMAIL CA' from issuer 'C=U.S, OU=DoD, CN=DoD EMAIL CA', call GDX509Certificate_issuer_relative_name(certificate, "CN")

Parameters
certificateof interest.
relative_namein short form to extract. For example 'CN, 'OU', etc'.
Returns
relative name or empty C-string if not found. The return value is stored in a reusable buffer that will be overwritten when called again. The caller does not have to free the result.

◆ GDX509Certificate_subject_relative_name()

const char* GDX509Certificate_subject_relative_name ( const struct GDX509Certificate certificate,
const char *  relative_name 
)

Call this function to extract the relative name from within the subject's fully-qualified distinguished name. For example, to extract the common name 'John Doe' from subject 'C=U.S, OU=DoD, CN=John Doe', call GDX509Certificate_subject_relative_name(certificate, "CN")

Parameters
certificateof interest.
relative_namein short form to extract. For example 'CN, 'OU', etc'.
Returns
relative name or empty C-string if not found. The return value is stored in a reusable buffer that will be overwritten when called again. The caller does not have to free the result.