2 * WebNewKeyGeneration.h
5 * Created by Chris Blumenberg on Mon Aug 23 2004.
6 * Copyright (c) 2003 Apple Computer. All rights reserved.
10 #ifndef WEB_KEY_GENERATION_H
11 #define WEB_KEY_GENERATION_H
13 #import <WebKit/WebKeyGenerator.h>
15 #ifdef USE_NEW_KEY_GENERATION
17 #import <CoreFoundation/CoreFoundation.h>
19 #import <Security/asn1Templates.h>
20 #import <Security/SecAsn1Coder.h>
21 #import <Security/secasn1t.h>
22 #import <Security/Security.h>
29 * Netscape Certifiate Sequence is defined by Netscape as a PKCS7
30 * ContentInfo with a contentType of netscape-cert-sequence and a content
31 * consisting of a sequence of certificates.
33 * For simplicity - i.e., to avoid the general purpose ContentInfo
34 * polymorphism - we'll just hard-code this particular type right here.
36 * Inside the ContentInfo is an array of standard X509 certificates.
37 * We don't need to parse the certs themselves so they remain as
41 CSSM_OID contentType; // netscape-cert-sequence
43 } NetscapeCertSequence;
45 extern const SecAsn1Template NetscapeCertSequenceTemplate[];
48 * Public key/challenge, to send to CA.
50 * PublicKeyAndChallenge ::= SEQUENCE {
52 *   spki SubjectPublicKeyInfo,
56 * SignedPublicKeyAndChallenge ::= SEQUENCE {
57 * publicKeyAndChallenge PublicKeyAndChallenge,
58 * signatureAlgorithm AlgorithmIdentifier,
59 * signature BIT STRING
63 CSSM_X509_SUBJECT_PUBLIC_KEY_INFO spki;
64 CSSM_DATA challenge; // ASCII
65 } PublicKeyAndChallenge;
68 PublicKeyAndChallenge pubKeyAndChallenge;
69 CSSM_X509_ALGORITHM_IDENTIFIER algId;
70 CSSM_DATA signature; // length in BITS
71 } SignedPublicKeyAndChallenge;
73 extern const SecAsn1Template PublicKeyAndChallengeTemplate[];
74 extern const SecAsn1Template SignedPublicKeyAndChallengeTemplate[];
76 CFStringRef signedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
77 WebCertificateParseResult addCertificatesToKeychainFromData(const void *bytes, unsigned length);
83 #endif /* USE_NEW_KEY_GENERATION */
85 #endif /* WEB_KEY_GENERATION_H */