]> git.saurik.com Git - apple/security.git/blob - SecurityASN1/asn/appleoids.asn
Security-30.1.tar.gz
[apple/security.git] / SecurityASN1 / asn / appleoids.asn
1 APPLE-OIDS
2 DEFINITIONS IMPLICIT TAGS ::=
3 BEGIN
4 -- EXPORTS All --
5
6 IMPORTS
7 BigIntegerStr
8 FROM VdaEnhancedTypes
9 ;
10
11 -- base OIDs for Apple, Apple Data Security
12 appleBaseOid OBJECT IDENTIFIER ::= { 1 2 840 113635 }
13 appleDataSecurity OBJECT IDENTIFIER ::= { appleBaseOid 100 }
14
15 -- base OIDs for Apple Trust Policies and Algorithms
16 appleTrustPolicy OBJECT IDENTIFIER ::= { appleDataSecurity 1 }
17 appleSecurityAlgorithm OBJECT IDENTIFIER ::=Ê{ appleDataSecurity 2 }
18
19 -- Apple trust policy OIDs
20
21 appleISignTP OBJECT IDENTIFIER ::= { appleTrustPolicy 1 }
22 appleX509Basic OBJECT IDENTIFIER ::= { appleTrustPolicy 2 }
23 appleSSLPolicy OBJECT IDENTIFIER ::= { appleTrustPolicy 3 }
24
25 -- Apple algorithms
26 appleFee OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 1 }
27 appleAsc OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 2 }
28 appleFeeMD5 OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 3 }
29 appleFeeSHA1 OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 4 }
30 appleFeed OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 5 }
31 appleFeedExp OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 6 }
32 appleECDSA OBJECT IDENTIFIER ::= { appleSecurityAlgorithm 7 }
33
34 -- FEE ElGamal-style signature
35 FEEElGamalSignature ::= SEQUENCE {
36 u BigIntegerStr,
37 pmX BigIntegerStr
38 }
39
40 -- FEE ECDSA-style signature
41 FEEECDSASignature ::= SEQUENCE {
42 c BigIntegerStr,
43 d BigIntegerStr
44 }
45
46 -- FEE Curve parameters
47 FEEPrimeType ::= INTEGER { pt-mersenne(0), pt-fee(1), pt-general(2) }
48 FEECurveType ::= INTEGER { ct-montgomery(0), ct-weierstrass(1), ct-general(2) }
49
50 FEECurveParameters ::= SEQUENCE
51 {
52 primeType FEEPrimeType,
53 curveType FEECurveType,
54 q INTEGER, -- unsigned
55 k INTEGER, -- signed
56 m INTEGER,
57 a BigIntegerStr,
58 bb BigIntegerStr, -- can't use variable/field b
59 c BigIntegerStr,
60 x1Plus BigIntegerStr,
61 x1Minus BigIntegerStr,
62 cOrderPlus BigIntegerStr,
63 cOrderMinus BigIntegerStr,
64 x1OrderPlus BigIntegerStr,
65 x1OrderMinus BigIntegerStr,
66 basePrime BigIntegerStr OPTIONAL -- iff FEEPrimeType == pt-general
67 }
68
69 -- FEE keys
70
71 FEEPublicKey ::= SEQUENCE
72 {
73 version INTEGER,
74 curveParams FEECurveParameters,
75 plusX BigIntegerStr,
76 minusX BigIntegerStr,
77 plusY BigIntegerStr OPTIONAL -- iff FEECurveType == ct-weierstrass
78 }
79
80 FEEPrivateKey ::= SEQUENCE
81 {
82 version INTEGER,
83 curveParams FEECurveParameters,
84 privData BigIntegerStr
85 }
86
87 -- DSA keys
88 --
89 -- DSA private keys are represented as a PrivateKeyInfo (pkcs8); DSA public keys
90 -- are represented as SubjectPublicKeyInfo (sm_s509af). However, the public p, g,
91 -- and q parameters are expressed in the AlgorithmIdentifier.parameters
92 -- field which is an ANY type. To simplify encoding and decoding (AsnAny is a royal
93 -- hassle to deal with), we define new structs for the entire keys here.
94 -- NOTE: these definition are derived from reverse engineering the key blobs
95 -- created by BSAFE 4.0 using info type KI_DSA{Public,Private}BER. The BSAFE
96 -- documentation claims that this encoding is X9.20 compatible; however BSAFE
97 -- adds a field to the dss-params (here called DSABSafeParams) struct which
98 -- indicates the prime size in bits. The encoding and decoding implemented here
99 -- is verified to be compatible with BSAFE 4.0 but no othyer implementations of
100 -- DSA keys.
101 --
102 DSAPrivateKey ::= SEQUENCE
103 {
104 version INTEGER,
105 dsaAlg DSAAlgorithmId,
106 privateKey OCTET STRING
107 }
108
109 --
110 -- The publicKey is actually the DER encoding of an ASN integer, wrapped in a
111 -- BIT STRING.
112 --
113 DSAPublicKey ::= SEQUENCE
114 {
115 dsaAlg DSAAlgorithmId,
116 publicKey BIT STRING
117 }
118
119 --
120 -- A convenient replacement for a DSA AlgorithmIdentifier
121 --
122 DSAAlgorithmId ::= SEQUENCE
123 {
124 algorithm OBJECT IDENTIFIER, -- id_dsa from sm_cms
125 params DSABsafeParams
126 }
127
128 --
129 -- This is the "ANY" parameter from AlgorithmIdentifier.
130 --
131 DSABsafeParams ::= SEQUENCE
132 {
133 keySizeInBits INTEGER,
134 p BigIntegerStr,
135 q BigIntegerStr,
136 g BigIntegerStr
137 }
138
139 --
140 -- DSAPrivateKey.privateKey is actually the DER encoding, as an AsnOcts, of this.
141 --
142 DSAPrivateKeyOcts ::= SEQUENCE
143 {
144 privateKey BigIntegerStr
145 }
146
147 --
148 -- DSA signature
149 --
150 DSASignature ::= SEQUENCE
151 {
152 r BigIntegerStr,
153 s BigIntegerStr
154 }
155
156 --
157 -- Encoding of the basic DSA parameters for use in a CDSA key generation context.
158 --
159 DSAAlgParams ::= SEQUENCE
160 {
161 p BigIntegerStr,
162 q BigIntegerStr,
163 g BigIntegerStr
164 }
165
166 END -- APPLE-OIDS
167