Inherits from NSObject
Conforms to NSCopying
PGPExportable
Declared in PGPKey.h

Overview

Public + Private key with the same ID.

Tasks

Properties

expirationDate

@property (nonatomic, nullable, readonly) NSDate *expirationDate

isEncryptedWithPassword

@property (nonatomic, readonly) BOOL isEncryptedWithPassword
Discussion

Whether key is encrypted

Declared In

PGPKey.h

isPublic

@property (nonatomic, readonly) BOOL isPublic
Discussion

Whether key is public.

Declared In

PGPKey.h

isSecret

@property (nonatomic, readonly) BOOL isSecret
Discussion

Whether key is secret.

Declared In

PGPKey.h

keyID

@property (nonatomic, readonly) PGPKeyID *keyID
Discussion

Key ID

Declared In

PGPKey.h

publicKey

@property (nonatomic, nullable, copy, readonly) PGPPartialKey *publicKey

secretKey

@property (nonatomic, nullable, copy, readonly) PGPPartialKey *secretKey

signingSecretKey

@property (nonatomic, nullable, readonly) PGPSecretKeyPacket *signingSecretKey

Instance Methods

decryptedWithPassphrase:error:

- (nullable PGPKey *)decryptedWithPassphrase:(NSString *)passphrase error:(NSError *__autoreleasing _Nullable *)error
Discussion

Decrypts key. Warning: It is not good idea to keep decrypted key around

Parameters

passphrase

Passphrase

error

error

Return Value

Decrypted key, or nil.

Declared In

PGPKey.h

export:error:NS_SWIFT_NAME:

- (nullable NSData *)export:(PGPPartialKeyType)keyType error:(NSError *__autoreleasing _Nullable *)error NS_SWIFT_NAME
Discussion

The binary format.

If you need ASCII format, you can use PGPArmor.

Declared In

PGPKey.h

initWithSecretKey:publicKey:

- (instancetype)initWithSecretKey:(nullable PGPPartialKey *)secretKey publicKey:(nullable PGPPartialKey *)publicKey
Discussion

Initialize the key with partial keys

Declared In

PGPKey.h