<commit_before>//
//  GPGKey.h
//  GPGME
//
//  Created by <EMAIL> on Tue Aug 14 2001.
//
//
//  Copyright (C) 2001 Mac GPG Project.
//  
//  This code is free software; you can redistribute it and/or modify it under
//  the terms of the GNU General Public License as published by the Free
//  Software Foundation; either version 2 of the License, or any later version.
//  
//  This code is distributed in the hope that it will be useful, but WITHOUT ANY
//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
//  details.
//  
//  For a copy of the GNU General Public License, visit <http://www.gnu.org/> or
//  write to the Free Software Foundation, Inc., 59 Temple Place--Suite 330,
//  Boston, MA 02111-1307, USA.
//  
//  More info at <http://macgpg.sourceforge.net/> or <<EMAIL>>
//

#import <GPGME/GPGObject.h>
#import <GPGME/GPGRecipients.h>


@class NSArray;
@class NSCalendarDate;
@class NSDictionary;
@class NSString;


/*"
 * Algorithm numerical values (taken from OpenPGP, RFC2440)
"*/
/*"
 * Public key algorithms
"*/
enum {
    GPG_RSAAlgorithm                = 1,  // Encrypt or Sign
    GPG_RSAEncryptOnlyAlgorithm     = 2,  // aka RSA-E
    GPG_RSASignOnlyAlgorithm        = 3,  // aka RSA-S
    GPG_ElgamalEncryptOnlyAlgorithm = 16, // aka Elgamal-E
    GPG_DSAAlgorithm                = 17, // Digital Signature Standard
    GPG_EllipticCurveAlgorithm      = 18,
    GPG_ECDSAAlgorithm              = 19,
    GPG_ElgamalAlgorithm            = 20,
    GPG_DiffieHellmanAlgorithm      = 21  // Encrypt or Sign
};

/*"
 * Symetric key algorithms
"*/
enum {
    GPG_NoAlgorithm          = 0,   // Unencrypted data
    GPG_IDEAAlgorithm        = 1,
    GPG_TripleDESAlgorithm   = 2,   // aka 3DES or DES-EDE - 168 bit key derived from 192
    GPG_CAST5Algorithm       = 3,   // 128 bit key
    GPG_BlowfishAlgorithm    = 4,   // 128 bit key, 16 rounds
    GPG_SAFER_SK128Algorithm = 5,   // 13 rounds
    GPG_DES_SKAlgorithm      = 6,
    GPG_AES128Algorithm      = 7,   // aka Rijndael
    GPG_AES192Algorithm      = 8,   // aka Rijndael 192
    GPG_AES256Algorithm      = 9,   // aka Rijndael 256
    GPG_TwoFishAlgorithm     = 10,  // twofish 256 bit
    GPG_SkipjackAlgorithm    = 101, // Experimental: skipjack
    GPG_TwoFish_OldAlgorithm = 102, // Experimental: twofish 128 bit
    GPG_DummyAlgorithm       = 110  // No encryption at all
};

/*"
 * Hash algorithms
"*/
enum {
    GPG_MD5HashAlgorithm            = 1,
    GPG_SHA_1HashAlgorithm          = 2,
    GPG_RIPE_MD160HashAlgorithm     = 3,
    GPG_DoubleWidthSHAHashAlgorithm = 4,
    GPG_MD2HashAlgorithm            = 5,
    GPG_TIGER192HashAlgorithm       = 6,
    GPG_HAVALHashAlgorithm          = 7  // 5 pass, 160 bit
};


@interface GPGKey : GPGObject
{
}

- (NSString *) xmlDescription;
//- (NSDictionary *) dictionaryRepresentation;
// Uses the same keys as in XML representation, but places
// subkeys in an array keyed by "subkeys", and userIDs
// in an array keyed by "userids". Optional/boolean values are
// represented as NSNumbers. Time values are represented
// as NSCalendarDates

- (NSString *) keyID;
- (NSArray *) subkeysKeyIDs;

- (NSString *) fingerprint;
- (NSArray *) subkeysFingerprints;

- (unsigned int) algorithm;
- (NSArray *) subkeysAlgorithms;

- (unsigned int) length;
- (NSArray *) subkeysLengths;

- (NSCalendarDate *) creationDate;
- (NSArray *) subkeysCreationDates;

// Not yet implemented
//- (NSCalendarDate *) expirationDate;
// Returns main key expiration date
//- (NSArray *) subkeysCreationDates;
// Returns an array of NSCalendarDate instances

//- (unsigned long) ownerTrust;

- (NSString *) userID;
- (NSArray *) userIDs;

- (NSString *) name;
- (NSArray *) names;

- (NSString *) email;
- (NSArray *) emails;

- (NSString *) comment;
- (NSArray *) comments;

- (GPGValidity) validity;
- (NSArray *) validities;

//- (unsigned int) type; Not yet implemented
<commit_msg>Tried to implement some functions, only to find that they were not yet implemented in GPGME.  :-/  Updated comments to make this clearer so that no one wastes time like I did.<commit_after>//
//  GPGKey.h
//  GPGME
//
//  Created by <EMAIL> on Tue Aug 14 2001.
//
//
//  Copyright (C) 2001 Mac GPG Project.
//  
//  This code is free software; you can redistribute it and/or modify it under
//  the terms of the GNU General Public License as published by the Free
//  Software Foundation; either version 2 of the License, or any later version.
//  
//  This code is distributed in the hope that it will be useful, but WITHOUT ANY
//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
//  details.
//  
//  For a copy of the GNU General Public License, visit <http://www.gnu.org/> or
//  write to the Free Software Foundation, Inc., 59 Temple Place--Suite 330,
//  Boston, MA 02111-1307, USA.
//  
//  More info at <http://macgpg.sourceforge.net/> or <<EMAIL>>
//

#import <GPGME/GPGObject.h>
#import <GPGME/GPGRecipients.h>


@class NSArray;
@class NSCalendarDate;
@class NSDictionary;
@class NSString;


/*"
 * Algorithm numerical values (taken from OpenPGP, RFC2440)
"*/
/*"
 * Public key algorithms
"*/
enum {
    GPG_RSAAlgorithm                = 1,  // Encrypt or Sign
    GPG_RSAEncryptOnlyAlgorithm     = 2,  // aka RSA-E
    GPG_RSASignOnlyAlgorithm        = 3,  // aka RSA-S
    GPG_ElgamalEncryptOnlyAlgorithm = 16, // aka Elgamal-E
    GPG_DSAAlgorithm                = 17, // Digital Signature Standard
    GPG_EllipticCurveAlgorithm      = 18,
    GPG_ECDSAAlgorithm              = 19,
    GPG_ElgamalAlgorithm            = 20,
    GPG_DiffieHellmanAlgorithm      = 21  // Encrypt or Sign
};

/*"
 * Symetric key algorithms
"*/
enum {
    GPG_NoAlgorithm          = 0,   // Unencrypted data
    GPG_IDEAAlgorithm        = 1,
    GPG_TripleDESAlgorithm   = 2,   // aka 3DES or DES-EDE - 168 bit key derived from 192
    GPG_CAST5Algorithm       = 3,   // 128 bit key
    GPG_BlowfishAlgorithm    = 4,   // 128 bit key, 16 rounds
    GPG_SAFER_SK128Algorithm = 5,   // 13 rounds
    GPG_DES_SKAlgorithm      = 6,
    GPG_AES128Algorithm      = 7,   // aka Rijndael
    GPG_AES192Algorithm      = 8,   // aka Rijndael 192
    GPG_AES256Algorithm      = 9,   // aka Rijndael 256
    GPG_TwoFishAlgorithm     = 10,  // twofish 256 bit
    GPG_SkipjackAlgorithm    = 101, // Experimental: skipjack
    GPG_TwoFish_OldAlgorithm = 102, // Experimental: twofish 128 bit
    GPG_DummyAlgorithm       = 110  // No encryption at all
};

/*"
 * Hash algorithms
"*/
enum {
    GPG_MD5HashAlgorithm            = 1,
    GPG_SHA_1HashAlgorithm          = 2,
    GPG_RIPE_MD160HashAlgorithm     = 3,
    GPG_DoubleWidthSHAHashAlgorithm = 4,
    GPG_MD2HashAlgorithm            = 5,
    GPG_TIGER192HashAlgorithm       = 6,
    GPG_HAVALHashAlgorithm          = 7  // 5 pass, 160 bit
};


@interface GPGKey : GPGObject
{
}

- (NSString *) xmlDescription;
//- (NSDictionary *) dictionaryRepresentation;
// Uses the same keys as in XML representation, but places
// subkeys in an array keyed by "subkeys", and userIDs
// in an array keyed by "userids". Optional/boolean values are
// represented as NSNumbers. Time values are represented
// as NSCalendarDates

- (NSString *) keyID;
- (NSArray *) subkeysKeyIDs;

- (NSString *) fingerprint;
- (NSArray *) subkeysFingerprints;

- (unsigned int) algorithm;
- (NSArray *) subkeysAlgorithms;

- (unsigned int) length;
- (NSArray *) subkeysLengths;

- (NSCalendarDate *) creationDate;
- (NSArray *) subkeysCreationDates;

// not yet implimented in GPGME as of 0.2.2
// don't work on them, there's no way to get this info
//- (NSCalendarDate *) expirationDate;
//- (NSArray *) subkeysExpirationDates;

// not yet implimented in GPGME as of 0.2.2
// don't work on them, there's no way to get this info
//- (unsigned long) ownerTrust;

- (NSString *) userID;
- (NSArray *) userIDs;

- (NSString *) name;
- (NSArray *) names;

- (NSString *) email;
- (NSArray *) emails;

- (NSString *) comment;
- (NSArray *) comments;

- (GPGValidity) validity;
- (NSArray *) validities;

// not yet implimented in GPGME as of 0.2.2
// don't work on them, there's no way to get this info
//- (unsigned int) type;

{'fraction_non_alphanumeric': 0.10511773185968284, 'fraction_numerical': 0.03159538683325324, 'mean_word_length': 2.636959370904325, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2152141', 'n_tokens_mistral': 3007, 'n_tokens_neox': 2679, 'n_words': 852}