blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal

GDCredential.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2018 BlackBerry Limited. All rights reserved.
00003  */
00004 
00005 #ifndef GD_CREDENTIAL_H
00006 #define GD_CREDENTIAL_H
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011   
00012 #ifndef GD_C_API
00013 #   if !defined(_WIN32)
00014 #       define GD_C_API __attribute__((visibility("default")))
00015 #   else
00016 #       define GD_C_API
00017 #   endif
00018 #endif
00019   
00020 #include "GDCommon.h"
00021 #include <time.h>
00022 
00046 struct GD_C_API GDX509Certificate {
00053     char* issuer;
00054 
00061     char* subject;
00062 
00070     char* subjectAlternativeName;
00071     
00078     char* serialNumber;
00079     
00087     char* publicKeyMD5;
00088     
00096     char* publicKeySHA1;
00097     
00105     char* certificateMD5;
00106     
00114     char* certificateSHA1;
00115     
00122     time_t notBefore;
00123     
00130     time_t notAfter;
00131     
00137     bool valid;
00138 
00143     char* keyUsage;
00144     
00149     char* extendedKeyUsage;
00150 
00156     struct GDData x509;
00157 };
00158 
00162 struct GD_C_API GDX509;
00163 
00173 GD_C_API struct GDX509Certificate* GDX509Certificate_create(const struct GDX509* certificate);
00174 
00181 GD_C_API void GDX509Certificate_free(struct GDX509Certificate* certificate);
00182 
00183 
00207 struct GD_C_API GDCredential {
00213     struct GDX509Certificate* userCertificate;
00214 
00221     size_t auxCount;
00222     
00232     struct GDX509Certificate* auxCertificates;
00233 };
00234 
00316  GD_C_API bool GDCredential_import(char** profileId,
00317                                    const struct GDData* credential,
00318                                    const char* password,
00319                                    struct GDError* error);
00320 
00332 GD_C_API void GDCredential_importDone();
00333 
00383 GD_C_API bool GDCredential_list(const char* profileId,
00384                                 size_t* credentialCount,
00385                                 struct GDCredential** credentials,
00386                                 struct GDError* error);
00387 
00397 GD_C_API void GDCredential_free(struct GDCredential* credentials, size_t credentialCount);
00398 
00403 #ifdef __cplusplus
00404 }
00405 #endif
00406 
00407 #endif