MYParsedCertificate.h
author Jens Alfke <jens@mooseyard.com>
Wed Jun 03 17:20:53 2009 -0700 (2009-06-03)
changeset 17 90a70925562b
child 19 f6c91b9da05b
permissions -rw-r--r--
Added MYParsedCertificate, for working with the innards of X.509 certs. Currently it can parse cert data, extract the public key, and verify the signature. More to come.
jens@17
     1
//
jens@17
     2
//  MYParsedCertificate.h
jens@17
     3
//  MYCrypto
jens@17
     4
//
jens@17
     5
//  Created by Jens Alfke on 6/2/09.
jens@17
     6
//  Copyright 2009 Jens Alfke. All rights reserved.
jens@17
     7
//
jens@17
     8
jens@17
     9
#import <Foundation/Foundation.h>
jens@17
    10
@class MYCertificate, MYOID;
jens@17
    11
jens@17
    12
/** A parsed X.509 certificate. Can be used to get more info about an existing cert,
jens@17
    13
    or to modify a self-signed cert and regenerate it. */
jens@17
    14
@interface MYParsedCertificate : NSObject 
jens@17
    15
{
jens@17
    16
    NSData *_data;
jens@17
    17
    id _root;
jens@17
    18
    MYCertificate *_issuer;
jens@17
    19
}
jens@17
    20
jens@17
    21
+ (MYOID*) RSAWithSHA1AlgorithmID;
jens@17
    22
jens@17
    23
- (id) initWithCertificateData: (NSData*)data error: (NSError**)outError;
jens@17
    24
jens@17
    25
/** Associates the certificate to its issuer.
jens@17
    26
    If the cert is not self-signed, you must manually set this property before verifying. */
jens@17
    27
@property (retain) MYCertificate* issuer;
jens@17
    28
jens@17
    29
@end