AppAuth
Class Methods | List of all members
OIDTokenUtilities Class Reference

Provides data encoding/decoding methods, random string generators, etc. More...

#import <OIDTokenUtilities.h>

Inheritance diagram for OIDTokenUtilities:

Class Methods

(NSString *) + encodeBase64urlNoPadding:
 Base64url-nopadding encodes the given data. More...
 
(nullable NSString *) + randomURLSafeStringWithSize:
 Generates a URL-safe string of random data. More...
 
(NSData *) + sha256:
 SHA256 hashes the input string. More...
 
(nullable NSString *) + redact:
 Truncated intput string after first 6 characters followed by ellipses. More...
 
(NSString *) + formUrlEncode:
 Form url encode the input string by applying application/x-www-form-urlencoded algorithm. More...
 

Detailed Description

Provides data encoding/decoding methods, random string generators, etc.

Method Documentation

◆ encodeBase64urlNoPadding:()

+ (NSString *) encodeBase64urlNoPadding: (NSData *)  data

Base64url-nopadding encodes the given data.

Parameters
dataThe input data.
Returns
The base64url encoded data as a NSString. @discussion Base64url-nopadding is used in several identity specs such as PKCE and OpenID Connect.

◆ formUrlEncode:()

+ (NSString*) formUrlEncode: (NSString *)  inputString

Form url encode the input string by applying application/x-www-form-urlencoded algorithm.

Parameters
inputStringThe input string.
Returns
The encoded string.

◆ randomURLSafeStringWithSize:()

+ (nullable NSString *) randomURLSafeStringWithSize: (NSUInteger)  size

Generates a URL-safe string of random data.

Parameters
sizeThe number of random bytes to encode. NB. the length of the output string will be greater than the number of random bytes, due to the URL-safe encoding.
Returns
Random data encoded with base64url.

◆ redact:()

+ (nullable NSString *) redact: (nullable NSString *)  inputString

Truncated intput string after first 6 characters followed by ellipses.

Parameters
inputStringThe input string.
Returns
Truncated string.

◆ sha256:()

+ (NSData *) sha256: (NSString *)  inputString

SHA256 hashes the input string.

Parameters
inputStringThe input string.
Returns
The SHA256 data.

The documentation for this class was generated from the following file: