# GPGKeySignature

> Inherits From:
>   GPGSignature : NSObject

> Declared In:
>   GPGME/GPGKeySignature.h

## Class Description

Key signatures are one component of a GPGKey object, and validate user IDs on the key.

The signatures on a key are only available if the key was retrieved via a listing operation with the GPGKeyListModeSignatures mode enabled, because it is expensive to retrieve all signatures of a key.

GPGKeySignature instances are returned by -[GPGUserID signatures]; you should never need to instantiate yourself objects of that class. It is guaranteed that the owning GPGUserID instance will never be deallocated before the GPGKeySignature has been deallocated, without creating non-breakable retain-cycles.

An instance represents a signature on a user ID of a key.

Key signatures raise a NSInternalInconsistencyException when methods -fingerprint, -summary, -notations, -policyURLs, -validity, -validityError, -wrongKeyUsage, -validityDescription, -hashAlgorithm, -hashAlgorithmDescription are invoked.

## Symbolic Constants

> #### Synopsis:

> `GPGKEYSIGNATURE_H`

## Instance Variables

> `BOOL _isRevocationSignature;`
> `BOOL _hasSignatureExpired;`
> `BOOL _isSignatureInvalid;`
> `BOOL _isExportable;`
> `NSString *_signerKeyID;`
> `NSString *_userID;`
> `NSString *_name;`
> `NSString *_email;`
> `NSString *_comment;`
> `GPGUserID *_signedUserID;`
> `int _refCount;`

> _isRevocationSignature | No description.
> _hasSignatureExpired | No description.
> _isSignatureInvalid | No description.
> _isExportable | No description.
> _signerKeyID | No description.
> _userID | No description.
> _name | No description.
> _email | No description.
> _comment | No description.
> _signedUserID | Signed userID; not retained
> _refCount | No description.

## Method Types

> Attributes
>   - signerKeyID
>   - userID
>   - name
>   - email
>   - comment
>   - creationDate
>   - expirationDate
>   - isRevocationSignature
>   - hasSignatureExpired
>   - isSignatureInvalid
>   - isExportable
>   - status
>   - signedUserID

## Instance Methods

### comment

`- (NSString *)comment`

Returns the comment on the signer's key, if available. Taken from the main user ID of the signer's key.

### creationDate

`- (NSCalendarDate *)creationDate`

Returns signature creation date. Returns nil when not available or invalid.

### email

`- (NSString *)email`

Returns the email address on the signer's key, if available. Taken from the main user ID of the signer's key.

### expirationDate

`- (NSCalendarDate *)expirationDate`

Returns signature expiration date. Returns nil when not available or invalid.

### hasSignatureExpired

`- (BOOL)hasSignatureExpired`

Returns whether signature has expired or not.

### isExportable

`- (BOOL)isExportable`

Returns whether signature is exportable or not (locally signed).

### isRevocationSignature

`- (BOOL)isRevocationSignature`

Returns whether the signature is a revocation signature or not.

### isSignatureInvalid

`- (BOOL)isSignatureInvalid`

Returns whether signature is invalid or not.

### name

`- (NSString *)name`

Returns the name on the signer's key, if available. Taken from the main user ID of the signer's key.

### signedUserID

`- (GPGUserID *)signedUserID`

Returns the GPGUserID signed by this signature.

### signerKeyID

`- (NSString *)signerKeyID`

Returns the key ID of the signer's key.

### status

`- (GPGError)status`

Returns signature status.

In particular, the following status codes are of interest:

GPGErrorNoError | This status indicates that the signature is valid.
GPGErrorSignatureExpired | This status indicates that the signature is valid but expired.
GPGErrorKeyExpired | This status indicates that the signature is valid but the key used to verify the signature has expired.
GPGErrorBadSignature | This status indicates that the signature is invalid.
GPGErrorNoPublicKey | This status indicates that the signature could not be verified due to a missing key.
GPGErrorGeneralError | This status indicates that there was some other error which prevented the signature verification.

### userID

`- (NSString *)userID`

Returns the main user ID of the signer's key.

Version 1.1 Copyright ©2005 by Mac GPG Project. All Rights Reserved. Sun Jan 23 16:54:42 2005