forked from glebd/cocoafob
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed old classes, added libcrypto to the project; builds OK
- Loading branch information
Gleb Dolgich
committed
Mar 1, 2009
1 parent
88ad6bc
commit fd6d23b
Showing
5 changed files
with
142 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,66 @@ | ||
// | ||
// PxLicGenerator.h | ||
// pxlic | ||
// CFobLicGenerator.h | ||
// CocoaFob | ||
// | ||
// Created by Gleb Dolgich on 09/02/2009. | ||
// Follow me on Twitter @gbd. | ||
// Copyright 2009 PixelEspresso. All rights reserved. | ||
// Copyright (C) 2009 PixelEspresso. All rights reserved. | ||
// Licensed under CC Attribution License <http://creativecommons.org/licenses/by/3.0/> | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <openssl/dsa.h> | ||
|
||
@interface PxLicGenerator : NSObject { | ||
/*! | ||
@class CFobLicGenerator | ||
@superclass NSObject | ||
@abstract Generates CocoaFob-style registration codes. | ||
@discussion Given user name and DSA private key, generates a human-readable registration code. | ||
*/ | ||
@interface CFobLicGenerator : NSObject { | ||
DSA *dsa; | ||
NSString *regName; | ||
NSString *regKey; | ||
NSString *regCode; | ||
NSString *lastError; | ||
} | ||
|
||
@property (nonatomic, copy) NSString *regName; | ||
@property (nonatomic, copy) NSString *regKey; | ||
@property (nonatomic, copy) NSString *regCode; | ||
@property (nonatomic, copy) NSString *lastError; | ||
|
||
/*! | ||
@method generatorWithPrivateKey: | ||
@abstract Creates a new registration code generator given DSA private key. | ||
@discussion Use this class method to create an autoreleased registration code generator. | ||
@param privKey PEM-encoded non-encrypted DSA private key. | ||
@result A new autoreleased registration code generator object. | ||
*/ | ||
+ (id)generatorWithPrivateKey:(NSString *)privKey; | ||
|
||
/*! | ||
@method initWithPrivateKey: | ||
@abstract Designated initializer that takes a DSA private key. | ||
@discussion Initializes registration code generator using a DSA private key. | ||
@param privKey PEM-encoded non-encrypted DSA private key. | ||
@result An initialized registration code generator object. | ||
*/ | ||
- (id)initWithPrivateKey:(NSString *)privKey; | ||
|
||
/*! | ||
@method setPrivateKey: | ||
@abstract Sets a new DSA private key. | ||
@discussion Sets a new DSA private key to be used for subsequent generated registration codes. | ||
@param privKey PEM-encoded non-encrypted DSA private key. | ||
@result YES on success, NO on error. | ||
*/ | ||
- (BOOL)setPrivateKey:(NSString *)privKey; | ||
|
||
/*! | ||
@method generate | ||
@abstract Generates a registration code from regName property. | ||
@discussion Takes regName property and DSA private key and generates a new registration code that is placed in regCode property. | ||
@result YES on success, NO on error. | ||
*/ | ||
- (BOOL)generate; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.