FRAQRUtils.h revision 465ea459a87d4605e145d8f45b6a9c104b696e3b
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings/*
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * The contents of this file are subject to the terms of the Common Development and
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * Distribution License (the License). You may not use this file except in compliance with the
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * License.
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings *
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * specific language governing permission and limitations under the License.
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings *
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * When distributing Covered Software, include this CDDL Header Notice in each file and include
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * Header, with the fields enclosed by brackets [] replaced by your own identifying
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * information: "Portions copyright [year] [name of copyright owner]".
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings *
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * Copyright 2016 ForgeRock AS.
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings */
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings/*!
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * Utility class for assisting in the reading of QR code uri strings.
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings */
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings@interface FRAQRUtils : NSObject
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell/*!
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell * replace characters for url decoding
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell */
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell+ (NSString *) replaceCharactersForURLDecoding:(NSString *)content;
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings/*!
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * decode a url from base 64 url encoded string
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings */
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell+ (NSData *) decodeURL:(NSString *) content;
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings/*!
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * decode a base 64 encoded string
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings */
465ea459a87d4605e145d8f45b6a9c104b696e3bCraig McDonnell+ (NSData *) decodeBase64:(NSString *) base64String;
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings/*!
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings * decode an encoded string
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings */
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings+ (NSString *) decode:(NSString*) str;
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni/*!
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni * Pad string with '=' to have length multiple of 4 (for base 64 decoding)
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni */
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni+ (NSString *) pad:(NSString*) str;
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni
c0a2f8c6e84ddf9a597f19e5f161382b0e2cf81bDiego Colantoni
9ebd9a731316dfd624ce3bcc4ea6519d10899936Ken Stubbings@end