2 * Copyright (c) 2000-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 * SecPkcs8Templates.h - ASN1 templates for private keys in PKCS8 format.
28 #ifndef _SEC_PKCS8_TEMPLATES_H_
29 #define _SEC_PKCS8_TEMPLATES_H_
31 #include <Security/cssmtype.h>
32 #include <Security/x509defs.h>
33 #include <Security/secasn1t.h>
40 * This one is the AlgorithmID.Parameters field for PKCS5 v1.5.
41 * It looks mighty similar to pkcs-12PbeParams except that this
42 * one has a fixed salt size of 8 bytes (not that we enforce that
48 } impExpPKCS5_PBE_Parameters
;
50 extern const SecAsn1Template impExpPKCS5_PBE_ParametersTemplate
[];
53 * This is the AlgorithmID.Parameters of the keyDerivationFunc component
54 * of a PBES2-params. PKCS v2.0 only. We do not handle the CHOICE salt;
55 * only the specified flavor (as an OCTET STRING).
59 CSSM_DATA iterationCount
;
60 CSSM_DATA keyLengthInBytes
; // optional
61 CSSM_OID prf
; // optional, default algid-hmacWithSHA1
62 } impExpPKCS5_PBKDF2_Params
;
64 extern const SecAsn1Template impExpPKCS5_PBKDF2_ParamsTemplate
[];
67 * AlgorithmID.Parameters for encryptionScheme component of of a PBES2-params.
71 CSSM_DATA version
; // optional
72 CSSM_DATA iv
; // 8 bytes
73 } impExpPKCS5_RC2Params
;
75 extern const SecAsn1Template impExpPKCS5_RC2ParamsTemplate
[];
81 CSSM_DATA version
; // not optional
82 CSSM_DATA rounds
; // 8..127
83 CSSM_DATA blockSizeInBits
; // 64 | 128
84 CSSM_DATA iv
; // optional, default is all zeroes
85 } impExpPKCS5_RC5Params
;
87 extern const SecAsn1Template impExpPKCS5_RC5ParamsTemplate
[];
90 * The top-level AlgID.Parameters for PKCS5 v2.0.
91 * keyDerivationFunc.Parameters is a impExpPKCS5_PBKDF2_Params.
92 * encryptionScheme.Parameters depends on the encryption algorithm:
94 * DES, 3DES: encryptionScheme.Parameters is an OCTET STRING containing the
96 * RC2: encryptionScheme.Parameters is impExpPKCS5_RC2Params.
97 * RC5: encryptionScheme.Parameters is impExpPKCS5_RC5Params.
100 CSSM_X509_ALGORITHM_IDENTIFIER keyDerivationFunc
;
101 CSSM_X509_ALGORITHM_IDENTIFIER encryptionScheme
;
102 } impExpPKCS5_PBES2_Params
;
104 extern const SecAsn1Template impExpPKCS5_PBES2_ParamsTemplate
[];
110 #endif /* _SEC_PKCS8_TEMPLATES_H_ */