]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_pkcs12/lib/pkcs12BagAttrs.h
2 * Copyright (c) 2003-2004,2011,2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
25 * pkcs12BagAttrs.h : internal representation of P12 SafeBag
26 * attribute, OTHER THAN friendlyName and localKeyId.
27 * This corresponds to a SecPkcs12AttrsRef at the
31 #ifndef _PKCS12_BAG_ATTRS_H_
32 #define _PKCS12_BAG_ATTRS_H_
34 #include <Security/keyTemplates.h> // for NSS_Attribute
35 #include <security_asn1/SecNssCoder.h>
36 #include <CoreFoundation/CoreFoundation.h>
41 * Empty constructor used by P12SafeBag during decoding.
42 * Indivudual attrs not understood by P12SafeBag get added
51 * Copying constructor used by P12SafeBag during encoding.
54 const P12BagAttrs
*otherAttrs
, // optional
59 /* Raw getter used just prior to encode. */
60 unsigned numAttrs() const;
61 NSS_Attribute
*getAttr(
65 * Add an attr during decoding. Only "generic" attrs, other
66 * than friendlyName and localKeyId, are added here.
69 const NSS_Attribute
&attr
);
72 * Add an attr pre-encode, from SecPkcs12Add*() or
73 * SecPkcs12AttrsAddAttr().
76 const CFDataRef attrOid
,
77 const CFArrayRef attrValues
);
80 * getter, public API version
84 CFDataRef
*attrOid
, // RETURNED
85 CFArrayRef
*attrValues
); // RETURNED
88 NSS_Attribute
*reallocAttrs(
92 const NSS_Attribute
&src
,
96 * Stored in NSS form for easy encode
98 NSS_Attribute
**mAttrs
;
103 * In the most common usage, a P12BagAttrs's SecNssCoder is associated
104 * with the owning P12Coder's mCoder. In the case of a "standalone"
105 * P12BagAttrs's created by the app via SecPkcs12AttrsCreate(),
106 * this subclass is used, proving the P12BadAttr's SecNssCoder
109 class P12BagAttrsStandAlone
: public P12BagAttrs
112 P12BagAttrsStandAlone()
113 : P12BagAttrs(mPrivCoder
)
116 ~P12BagAttrsStandAlone() { }
119 SecNssCoder mPrivCoder
;
122 #endif /* _PKCS12_BAG_ATTRS_H_ */