]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_keychain/libDER/libDER/libDER.h
b17e4ba3740ab0711f8dff0369861d949a1b92d9
2 * Copyright (c) 2005-2007,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@
26 * libDER.h - main header for libDER, a ROM-capable DER decoding library.
37 #include <libDER/libDER_config.h>
39 * Error returns generated by this library.
43 DR_EndOfSequence
, /* end of sequence or set */
44 DR_UnexpectedTag
, /* unexpected tag found while decoding */
45 DR_DecodeError
, /* misc. decoding error (badly formatted DER) */
46 DR_Unimplemented
, /* function not implemented in this configuration */
47 DR_IncompleteSeq
, /* incomplete sequence */
48 DR_ParamErr
, /* incoming parameter error */
49 DR_BufOverflow
/* buffer overflow */
54 * The structure of a sequence during decode or encode is expressed as
55 * an array of DERItemSpecs. While decoding or encoding a sequence,
56 * each item in the sequence corresponds to one DERItemSpec.
59 DERSize offset
; /* offset of destination DERItem */
60 DERTag tag
; /* DER tag */
61 DERShort options
; /* DER_DEC_xxx or DER_ENC_xxx */
65 * Macro to obtain offset of a DERDecodedInfo within a struct.
66 * FIXME this is going to need reworking to avoid compiler warnings
67 * on 64-bit compiles. It'll work OK as long as an offset can't be larger
68 * than a DERSize, but the cast from a pointer to a DERSize may
69 * provoke compiler warnings.
71 #define DER_OFFSET(type, field) ((DERSize)(&((type *)0)->field))
77 #endif /* _LIB_DER_H_ */