2 DEFINITIONS IMPLICIT TAGS ::=
13 -- base OIDs for Apple, Apple Data Security
14 appleBaseOid OBJECT IDENTIFIER ::= { 1 2 840 113635 }
15 appleDataSecurity OBJECT IDENTIFIER ::= { appleBaseOid 100 }
17 -- base OIDs for Apple Trust Policies and Algorithms
18 appleTrustPolicy OBJECT IDENTIFIER ::= { appleDataSecurity 1 }
19 appleSecurityAlgorithm OBJECT IDENTIFIER ::=Ê{ appleDataSecurity 2 }
21 -- Apple trust policy OIDs
23 appleISignTP OBJECT IDENTIFIER ::= { appleTrustPolicy 1 }
24 appleX509Basic OBJECT IDENTIFIER ::= { appleTrustPolicy 2 }
25 appleSSLPolicy OBJECT IDENTIFIER ::= { appleTrustPolicy 3 }
28 appleFee OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 1 }
29 appleAsc OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 2 }
30 appleFeeMD5 OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 3 }
31 appleFeeSHA1 OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 4 }
32 appleFeed OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 5 }
33 appleFeedExp OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 6 }
34 appleECDSA OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 7 }
37 pkcs-3 OBJECT IDENTIFIER ::= { pkcs 3 }
38 dhKeyAgreement OBJECT IDENTIFIER ::= { pkcs-3 1 }
40 -- FEE ElGamal-style signature
41 FEEElGamalSignature ::= SEQUENCE {
46 -- FEE ECDSA-style signature
47 FEEECDSASignature ::= SEQUENCE {
52 -- FEE Curve parameters
53 FEEPrimeType ::= INTEGER { pt-mersenne(0), pt-fee(1), pt-general(2) }
54 FEECurveType ::= INTEGER { ct-montgomery(0), ct-weierstrass(1), ct-general(2) }
56 FEECurveParameters ::= SEQUENCE
58 primeType FEEPrimeType,
59 curveType FEECurveType,
60 q INTEGER, -- unsigned
64 bb BigIntegerStr, -- can't use variable/field b
67 x1Minus BigIntegerStr,
68 cOrderPlus BigIntegerStr,
69 cOrderMinus BigIntegerStr,
70 x1OrderPlus BigIntegerStr,
71 x1OrderMinus BigIntegerStr,
72 basePrime BigIntegerStr OPTIONAL -- iff FEEPrimeType == pt-general
77 FEEPublicKey ::= SEQUENCE
80 curveParams FEECurveParameters,
83 plusY BigIntegerStr OPTIONAL -- iff FEECurveType == ct-weierstrass
86 FEEPrivateKey ::= SEQUENCE
89 curveParams FEECurveParameters,
90 privData BigIntegerStr
95 -- DSA private keys are represented as a PrivateKeyInfo (pkcs8); DSA public keys
96 -- are represented as SubjectPublicKeyInfo (sm_s509af). However, the public p, g,
97 -- and q parameters are expressed in the AlgorithmIdentifier.parameters
98 -- field which is an ANY type. To simplify encoding and decoding (AsnAny is a royal
99 -- hassle to deal with), we define new structs for the entire keys here.
100 -- NOTE: these definition are derived from reverse engineering the key blobs
101 -- created by BSAFE 4.0 using info type KI_DSA{Public,Private}BER. The BSAFE
102 -- documentation claims that this encoding is X9.20 compatible; however BSAFE
103 -- adds a field to the dss-params (here called DSABSafeParams) struct which
104 -- indicates the prime size in bits. The encoding and decoding implemented here
105 -- is verified to be compatible with BSAFE 4.0 but no other implementations of
108 DSAPrivateKey ::= SEQUENCE
111 dsaAlg DSAAlgorithmId,
112 privateKey OCTET STRING
116 -- The publicKey is actually the DER encoding of an ASN integer, wrapped in a
119 DSAPublicKey ::= SEQUENCE
121 dsaAlg DSAAlgorithmId,
126 -- A convenient replacement for a DSA AlgorithmIdentifier
128 DSAAlgorithmId ::= SEQUENCE
130 algorithm OBJECT IDENTIFIER, -- id_dsa from sm_cms
131 params DSABsafeParams
135 -- This is the "ANY" parameter from AlgorithmIdentifier.
137 DSABsafeParams ::= SEQUENCE
139 keySizeInBits INTEGER,
146 -- DSAPrivateKey.privateKey is actually the DER encoding, as an AsnOcts, of this.
148 DSAPrivateKeyOcts ::= SEQUENCE
150 privateKey BigIntegerStr
154 -- DSA keys in openssl format.
156 -- Public keys are SubjectPublicKeyInfo. AlgorithmIdentifier.parameters
157 -- is a DSAAlgParams. We redefine the whole thing here to avoid AsnAny
160 -- The publicKey is actually the DER encoding of an ASN integer, wrapped in a
163 DSAPublicKeyX509 ::= SEQUENCE
165 dsaAlg DSAAlgorithmIdX509,
170 -- A convenient replacement for a DSA AlgorithmIdentifier, X509 format
172 DSAAlgorithmIdX509 ::= SEQUENCE
174 algorithm OBJECT IDENTIFIER, -- id_dsa from sm_cms
176 -- this replaces AsnAny parameters; it is the DSA parameter format
177 -- which is common to the CSP and to openssl
183 -- Private keys are one of these, which appears to be specific to openssl.
185 DSAPrivateKeyOpenssl ::= SEQUENCE
198 DSASignature ::= SEQUENCE
205 -- Encoding of the basic DSA parameters for use in a CDSA key generation context.
207 DSAAlgParams ::= SEQUENCE
214 -- Diffie Hellman per PKCS3
216 DHPrivateKey ::= SEQUENCE
218 dHOid OBJECT IDENTIFIER, -- dhKeyAgreement
220 secretPart BigIntegerStr
223 DHParameterBlock ::= SEQUENCE
225 oid OBJECT IDENTIFIER, -- pkcs-3
229 DHParameter ::= SEQUENCE
231 prime BigIntegerStr, -- p
232 base BigIntegerStr, -- g
233 privateValueLength BigIntegerStr OPTIONAL