forked from billymeltdown/cocoafob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCFobLicGenerator.h
42 lines (37 loc) · 1.31 KB
/
CFobLicGenerator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// CFobLicGenerator.h
// CocoaFob
//
// Created by Gleb Dolgich on 09/02/2009.
// Follow me on Twitter @glebd.
// Copyright (C) 2009-2015 PixelEspresso. All rights reserved.
// BSD License
//
#import <Foundation/Foundation.h>
#import <Security/Security.h>
/*!
@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 {
SecKeyRef _privateKey;
}
/*!
@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 error:(NSError **)err;
/*!
@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.
@param The name or registration string to generate a serial number for.
@result The serial number as a string, nil on failure.
*/
- (NSString *)generateRegCodeForName:(NSString *)name error:(NSError **)err;
@end