Skip to content

Commit

Permalink
Added passphrase field in key-generation dialog, for GPG 1.4.x users.
Browse files Browse the repository at this point in the history
Added log for initGPG.
  • Loading branch information
Mento committed Oct 10, 2010
1 parent 893ebd2 commit 48b5875
Show file tree
Hide file tree
Showing 17 changed files with 5,634 additions and 4,243 deletions.
2 changes: 1 addition & 1 deletion ActionController.h
Expand Up @@ -84,7 +84,7 @@ enum {
- (void)importFromData:(NSData *)data;
- (NSString *)importResultWithStatusData:(NSData *)data;

- (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:(NSString *)comment type:(NSInteger)type length:(NSInteger)length daysToExpire:(NSInteger)daysToExpire;
- (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:(NSString *)comment passphrase:(NSString *)passphrase type:(NSInteger)type length:(NSInteger)length daysToExpire:(NSInteger)daysToExpire;
- (void)addSubkeyForKeyInfo:(KeyInfo *)keyInfo type:(NSInteger)type length:(NSInteger)length daysToExpire:(NSInteger)daysToExpire;
- (void)addUserIDForKeyInfo:(KeyInfo *)keyInfo name:(NSString *)name email:(NSString *)email comment:(NSString *)comment;
- (void)addSignatureForKeyInfo:(KeyInfo *)keyInfo andUserID:(NSString *)userID signKey:(NSString *)signFingerprint type:(NSInteger)type local:(BOOL)local daysToExpire:(NSInteger)daysToExpire;
Expand Down
11 changes: 8 additions & 3 deletions ActionController.m
Expand Up @@ -757,7 +757,7 @@ - (IBAction)generateNewKey:(id)sender {
SheetController *sheetController = [SheetController sharedInstance];
[sheetController generateNewKey];
}
- (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:(NSString *)comment type:(NSInteger)type length:(NSInteger)length daysToExpire:(NSInteger)daysToExpire {
- (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:(NSString *)comment passphrase:(NSString *)passphrase type:(NSInteger)type length:(NSInteger)length daysToExpire:(NSInteger)daysToExpire {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSInteger keyType, subkeyType;

Expand All @@ -784,7 +784,7 @@ - (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:

NSMutableString *cmdText = [NSMutableString string];

[cmdText appendString:@"%ask-passphrase\n"];


[cmdText appendFormat:@"Key-Type: %i\n", keyType];
[cmdText appendFormat:@"Key-Length: %i\n", length];
Expand All @@ -799,8 +799,13 @@ - (void)generateNewKeyWithName:(NSString *)name email:(NSString *)email comment:
}
[cmdText appendFormat:@"Expire-Date: %i\n", daysToExpire];

[cmdText appendString:@"%commit\n"];
if (passphrase) {
[cmdText appendFormat:@"Passphrase: %@\n", passphrase];
} else {
[cmdText appendString:@"%ask-passphrase\n"];
}

[cmdText appendString:@"%commit\n"];

if (runGPGCommand(cmdText, nil, nil, @"--gen-key", nil) != 0) {
NSLog(@"generateNewKeyWithName: --gen-key fehlgeschlagen.");
Expand Down
10 changes: 2 additions & 8 deletions English.lproj/Localizable.strings
Expand Up @@ -35,13 +35,6 @@ GenerateUidSignature_Msg = "Make signature for user ID \"%@\", %@";
ChangeExpirationDate_Msg = "Change expiration date of \"%@\", %@";
ChangeSubkeyExpirationDate_Msg = "Change expiration date of \"%@\", %@\nSubkey: %@";

GenerateSubkey_Msg = "Add subkey to Key \"%@\", %@.";
GenerateUserID_Msg = "Add user ID to Key \"%@\", %@.";
GenerateSignature_Msg = "Make signature for all user IDs of \"%@\", %@";
GenerateUidSignature_Msg = "Make signature for user ID \"%@\", %@";
ChangeExpirationDate_Msg = "Change expiration date of \"%@\", %@";
ChangeSubkeyExpirationDate_Msg = "Change expiration date of \"%@\", %@\nSubkey: %@";


//Meldungen wenn die Eingabe nicht korrekt war.
CheckError_NameToShort = "Name must be at least 5 characters long!";
Expand All @@ -53,21 +46,22 @@ CheckError_EmailToLong = "E-Mail address is to long!\nMax length is 254.";
CheckError_InvalidCharInComment = "Invalid character in comment!\n\"(\" and \")\" not allowed.";
CheckError_CommentToLong = "Comment is to long!";
CheckError_NoKeyID = "Please enter a valid key ID!";
CheckError_PassphraseMissmatch = "Your passphrases did not match!";


//Meldungen beim Start, wenn es Probleme gibt.
GPGNotFound_Msg = "GPG2 not found!";
GPG1OnlyFound_Title = "GPG2 not found!";
GPG1OnlyFound_Msg = "Since at least GPG was found 1.4, most features should be available.";
GPGNotValid_Msg = "No valid GPG found!";
GPGInitError_Msg = "GPG could not be initialized!";
GPGAgentNotFound_Title = "gpg-agent not found!";
GPGAgentNotFound_Msg = "Without gpg-agent you can’t access passphrase protected keys.";
GPGAgentNotStart_Title = "gpg-agent could not be started!";
GPGAgentNotStart_Msg = "Without gpg-agent you can’t access passphrase protected keys.";
Quit_Button = "Quit";



//Sollte klar sein.
No = "No";
Error = "Error";
Expand Down
Binary file modified English.lproj/ModalSheets.strings
Binary file not shown.

0 comments on commit 48b5875

Please sign in to comment.