aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/asn1/PKCS-1.asn1
blob: b5754790e732ba9733d63626182b4b187a3c567b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
PKCS-1 {
    iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
    modules(0) pkcs-1(1)
}

-- $Revision: 1.1 $

DEFINITIONS EXPLICIT TAGS ::=

BEGIN

--IMPORTS id-sha256, id-sha384, id-sha512
--    FROM NIST-SHA2 {
--        joint-iso-itu-t(2) country(16) us(840) organization(1)
--        gov(101) csor(3) nistalgorithm(4) modules(0) sha2(1)
--    };

pkcs-1    OBJECT IDENTIFIER ::= {
    iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1
}

rsaEncryption    OBJECT IDENTIFIER ::= { pkcs-1 1 }

id-RSAES-OAEP    OBJECT IDENTIFIER ::= { pkcs-1 7 }

id-pSpecified    OBJECT IDENTIFIER ::= { pkcs-1 9 }

id-RSASSA-PSS    OBJECT IDENTIFIER ::= { pkcs-1 10 }

md2WithRSAEncryption       OBJECT IDENTIFIER ::= { pkcs-1 2 }
md5WithRSAEncryption       OBJECT IDENTIFIER ::= { pkcs-1 4 }
sha1WithRSAEncryption      OBJECT IDENTIFIER ::= { pkcs-1 5 }
sha256WithRSAEncryption    OBJECT IDENTIFIER ::= { pkcs-1 11 }
sha384WithRSAEncryption    OBJECT IDENTIFIER ::= { pkcs-1 12 }
sha512WithRSAEncryption    OBJECT IDENTIFIER ::= { pkcs-1 13 }
sha224WithRSAEncryption    OBJECT IDENTIFIER  ::=  { pkcs-1 14 }

-- ISO oid  - equvivalent to sha1WithRSAEncryption
sha-1WithRSAEncryption OBJECT IDENTIFIER ::= {
	iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) sha-1WithRSAEncryption(29)}

id-sha1    OBJECT IDENTIFIER ::= {
    iso(1) identified-organization(3) oiw(14) secsig(3)
    algorithms(2) 26
}

id-md2 OBJECT IDENTIFIER ::= {
    iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2
}

id-md5 OBJECT IDENTIFIER ::= {
    iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5
}

id-mgf1    OBJECT IDENTIFIER ::= { pkcs-1 8 }


RSAPublicKey ::= SEQUENCE {
    modulus           INTEGER,  -- n
    publicExponent    INTEGER   -- e
}

RSAPrivateKey ::= SEQUENCE {
    version           Version,
    modulus           INTEGER,  -- n
    publicExponent    INTEGER,  -- e
    privateExponent   INTEGER,  -- d
    prime1            INTEGER,  -- p
    prime2            INTEGER,  -- q
    exponent1         INTEGER,  -- d mod (p-1)
    exponent2         INTEGER,  -- d mod (q-1)
    coefficient       INTEGER,  -- (inverse of q) mod p
    otherPrimeInfos   OtherPrimeInfos OPTIONAL
}

Version ::= INTEGER { two-prime(0), multi(1) }
    (CONSTRAINED BY {
        -- version must be multi if otherPrimeInfos present --
    })

OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo

OtherPrimeInfo ::= SEQUENCE {
    prime             INTEGER,  -- ri
    exponent          INTEGER,  -- di
    coefficient       INTEGER   -- ti
}

Algorithm ::= SEQUENCE {
	algorithm OBJECT IDENTIFIER,
	parameters ANY DEFINED BY algorithm OPTIONAL
}

AlgorithmNull ::= SEQUENCE {
	algorithm OBJECT IDENTIFIER,
	parameters NULL
}


RSASSA-PSS-params ::= SEQUENCE {
    hashAlgorithm      [0] Algorithm,     --  DEFAULT sha1,
    maskGenAlgorithm   [1] Algorithm,     --  DEFAULT mgf1SHA1,
    saltLength         [2] INTEGER            DEFAULT 20,
    trailerField       [3] TrailerField       DEFAULT trailerFieldBC
}

TrailerField ::= INTEGER { trailerFieldBC(1) }

DigestInfo ::= SEQUENCE {
	digestAlgorithm Algorithm,
	digest OCTET STRING
}

DigestInfoNull ::= SEQUENCE {
	digestAlgorithm AlgorithmNull,
	digest OCTET STRING
}


END  -- PKCS1Definitions