Provisioning Certificates Using URLScheme with Afaria

Returns the certificate as a base64 encoded string if the URL Scheme is registered with Afaria.

Syntax

- (NSString *) getSignedCertificateFromAfariaForURLScheme: (NSString *) urlScheme
withUsername: (NSString *) username
withPassword: (NSString *) password

Parameters

  • urlScheme – URL scheme of the calling application. Afaria library can use this to pass it to the Afaria client.
  • username – Common name used to generate the CSR.
  • password – Certificate password.

Returns

Returns a certificate as a base64 encoded string

The application has to implement the standard receiver delegate
application:applicationDidFinishLaunchingWithOptions:
to handle the URL received from the Afaria client if the Afaria settings are missing.

Examples

  • Certificate Provisioning using URLScheme
     @try {
            LiteSUPCertificateStore* store = [LiteSUPCertificateStore getInstance];
            NSString* certBase64 = [store getSignedCertificateFromAfariaForURLScheme:@"SCHEME" withUsername:@"UserName" withPassword:@"password"];
            NSLog(@"%@", certBase64);
        }
        @catch (NSException *exception) {
            NSLog(@"%@", [exception reason]);
        }