]> git.saurik.com Git - apple/security.git/blame - OSX/libsecurity_ocspd/common/ocspExtensions.h
Security-58286.41.2.tar.gz
[apple/security.git] / OSX / libsecurity_ocspd / common / ocspExtensions.h
Content-type: text/html ]> git.saurik.com Git - apple/security.git/blame - OSX/libsecurity_ocspd/common/ocspExtensions.h


500 - Internal Server Error

Malformed UTF-8 character (fatal) at /usr/lib/x86_64-linux-gnu/perl5/5.40/HTML/Entities.pm line 485, <$fd> line 199.
CommitLineData
b1ab9ed8 1/*
d8f41ccd 2 * Copyright (c) 2004,2011,2014 Apple Inc. All Rights Reserved.
b1ab9ed8
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24/*
25 * ocspExtensions.h - OCSP extensions support
26 */
27
28#ifndef _OCSP_EXTENSIONS_H_
29#define _OCSP_EXTENSIONS_H_
30
31#include <Security/SecAsn1Coder.h>
32#include <Security/x509defs.h>
33#include <Security/X509Templates.h>
34#include <security_utilities/utilities.h>
35
36/*
37 * We deal with a well bounded set of extensions, so we can enumerate them
38 * here for convenience.
39 */
40typedef enum {
41 OET_Unknown, // no recognized
42 OET_Nonce,
43 OET_CrlReference,
44 OET_AcceptResponse,
45 OET_ArchiveCutoff,
46 OET_ServiceLocator
47} OCSPExtensionTag;
48
49class OCSPExtension
50{
51 NOCOPY(OCSPExtension);
52 /* note NO public constructor implemented by this class */
53public:
54 /* the public means to create an OCSPExtension subclass during decode */
55 static OCSPExtension *createFromNSS(
56 SecAsn1CoderRef coder,
57 const NSS_CertExtension &nssExt);
58
59 virtual ~OCSPExtension();
60
61 /* public accessors; suclass probably has others */
62 bool critical() { return mCritical; }
63 bool unrecognizedCritical() { return mUnrecognizedCritical; }
64 CSSM_OID &extnId() { return mNssExt->extnId; }
65 OCSPExtensionTag tag() { return mTag; }
66
67 /*
68 * When encoding, this is ready to go - i.e., we're ready to be encoded -
69 * once subclass has called setDerValue(). That happens during subclass's
70 * constructor.
71 */
72 NSS_CertExtension *nssExt() { return mNssExt; }
73
74protected:
75 /*
76 * Subclass must implement a version like this (without the tag argument),
77 * called from createFromNSS() during decode.
78 *
79 * This class's implementation just stashes away mNssExt, mCritical, and mCoder.
80 * This class's implementation is also used to construct the "I don't understand
81 * this extension" case (tag = OET_Unknown).
82 */
83 OCSPExtension(
84 SecAsn1CoderRef coder,
85 const NSS_CertExtension &nssExt,
86 OCSPExtensionTag tag);
87
88 /*
89