AGSecretBox Class Reference
Inherits from | NSObject |
Declared in | AGSecretBox.h AGSecretBox.m |
Instance Methods
decrypt:nonce:error:
Decrypts the data object provided given a nonce.
- (NSData *)decrypt:(NSData *)data nonce:(NSData *)nonce error:(NSError *__autoreleasing *)error
Parameters
- data
The data object(cipher) to decrypt.
- nonce
The cryptographically secure pseudorandom number.
- error
If an error occurs, upon return contains an
NSError
object that describes the problem.
Return Value
An NSData object that holds the decrypted data.
Discussion
Decrypts the data object provided given a nonce.
Declared In
AGSecretBox.h
encrypt:nonce:error:
Encrypts and authenticates the data object provided given a nonce.
- (NSData *)encrypt:(NSData *)data nonce:(NSData *)nonce error:(NSError *__autoreleasing *)error
Parameters
- data
The data object to encrypt.
- nonce
the cryptographically secure pseudorandom number.
- error
If an error occurs, upon return contains an
NSError
object that describes the problem.
Return Value
An NSData object that holds the encrypted(cipher) data.
Discussion
Encrypts and authenticates the data object provided given a nonce.
Declared In
AGSecretBox.h