Inherits from NSObject
Declared in AGCryptoBox.h
AGCryptoBox.m

Overview

Provide public key authenticated encryption via curve25519xsalsa20poly1305

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

AGCryptoBox.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

AGCryptoBox.h

initWithKey:privateKey:

Crypto box initialization

- (id)initWithKey:(NSData *)publicKey privateKey:(NSData *)privateKey

Parameters

publicKey

the public encryption key provided.

privateKey

the private encryption key provided.

Return Value

the AGCryptoBox object.

Discussion

Crypto box initialization

Declared In

AGCryptoBox.h

initWithKeyPair:

Crypto box default initialization

- (id)initWithKeyPair:(AGKeyPair *)keyPair

Parameters

keyPair

containig public and private keys provided.

Return Value

the AGCryptoBox object.

Discussion

Crypto box default initialization

Declared In

AGCryptoBox.h