• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 8.0.0.81
GDCredential.h
Go to the documentation of this file.
1 /*
2  * (c) 2018 BlackBerry Limited. All rights reserved.
3  */
4 
5 #ifndef GD_CREDENTIAL_H
6 #define GD_CREDENTIAL_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #ifndef GD_C_API
13 # if !defined(_WIN32)
14 # define GD_C_API __attribute__((visibility("default")))
15 # else
16 # define GD_C_API
17 # endif
18 #endif
19 
20 #include "GDCommon.h"
21 #include <time.h>
22 
46 struct GD_C_API GDX509Certificate {
53  char* issuer;
54 
61  char* subject;
62 
71 
78  char* serialNumber;
79 
87  char* publicKeyMD5;
88 
97 
106 
115 
122  time_t notBefore;
123 
130  time_t notAfter;
131 
137  bool valid;
138 
143  char* keyUsage;
144 
150 
156  struct GDData x509;
157 };
158 
162 struct GD_C_API GDX509;
163 
173 GD_C_API struct GDX509Certificate* GDX509Certificate_create(const struct GDX509* certificate);
174 
181 GD_C_API void GDX509Certificate_free(struct GDX509Certificate* certificate);
182 
183 
207 struct GD_C_API GDCredential {
214 
221  size_t auxCount;
222 
233 };
234 
316  GD_C_API bool GDCredential_import(char** profileId,
317  const struct GDData* credential,
318  const char* password,
319  struct GDError* error);
320 
332 GD_C_API void GDCredential_importDone(void);
333 
383 GD_C_API bool GDCredential_list(const char* profileId,
384  size_t* credentialCount,
385  struct GDCredential** credentials,
386  struct GDError* error);
387 
397 GD_C_API void GDCredential_free(struct GDCredential* credentials, size_t credentialCount);
398 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif
GDX509Certificate::serialNumber
char * serialNumber
X.509 Serial Number field.
Definition: GDCredential.h:78
GDCredential_importDone
void GDCredential_importDone(void)
Finalize credential import.
GDCredential
User identity credential certificate chain.
Definition: GDCredential.h:207
GDX509Certificate::publicKeyMD5
char * publicKeyMD5
MD5 hash of the public key.
Definition: GDCredential.h:87
GDCredential::auxCount
size_t auxCount
The number of auxiliary certificates.
Definition: GDCredential.h:221
GDX509Certificate::extendedKeyUsage
char * extendedKeyUsage
Extended key usage of the certificate.
Definition: GDCredential.h:149
GDCredential_free
void GDCredential_free(struct GDCredential *credentials, size_t credentialCount)
Free a returned credentials buffer.
GDX509Certificate
X.509 Public Key Certificate.
Definition: GDCredential.h:46
GDCommon.h
GDX509Certificate::valid
bool valid
Returns certificate validity.
Definition: GDCredential.h:137
GDX509Certificate::issuer
char * issuer
X.509 Issuer field.
Definition: GDCredential.h:53
GDX509Certificate::subjectAlternativeName
char * subjectAlternativeName
X.509 Subject Alternative Name field.
Definition: GDCredential.h:70
GDX509Certificate::notAfter
time_t notAfter
X.509 Validity: Not After date and time.
Definition: GDCredential.h:130
GDCredential_import
bool GDCredential_import(char **profileId, const struct GDData *credential, const char *password, struct GDError *error)
Import electronic certificate credentials from a PKCS #12 file.
GDX509Certificate_free
void GDX509Certificate_free(struct GDX509Certificate *certificate)
Free a certificate.
GDCredential_list
bool GDCredential_list(const char *profileId, size_t *credentialCount, struct GDCredential **credentials, struct GDError *error)
List available credentials for a User Credential Profile.
GDX509Certificate_create
struct GDX509Certificate * GDX509Certificate_create(const struct GDX509 *certificate)
Create a certificate.
GDX509Certificate::subject
char * subject
X.509 Subject field.
Definition: GDCredential.h:61
GDData
Data encapsulation structure.
Definition: GDCommon.h:136
GDX509Certificate::notBefore
time_t notBefore
X.509 Validity: Not Before date and time.
Definition: GDCredential.h:122
GDCredential::auxCertificates
struct GDX509Certificate * auxCertificates
Auxiliary intermediate certificates.
Definition: GDCredential.h:232
GDCredential::userCertificate
struct GDX509Certificate * userCertificate
Leaf certificate.
Definition: GDCredential.h:213
GDError
Error structure.
Definition: GDCommon.h:112
GDX509Certificate::certificateMD5
char * certificateMD5
MD5 hash of the public key.
Definition: GDCredential.h:105
GDX509Certificate::publicKeySHA1
char * publicKeySHA1
SHA-1 hash of the public key.
Definition: GDCredential.h:96
GDX509Certificate::keyUsage
char * keyUsage
Key usage of the certificate.
Definition: GDCredential.h:143
GDX509Certificate::certificateSHA1
char * certificateSHA1
SHA-1 hash of the certificate.
Definition: GDCredential.h:114