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