home *** CD-ROM | disk | FTP | other *** search
/ ftp.rsa.com / 2014.05.ftp.rsa.com.tar / ftp.rsa.com / pub / pkcs / pkcs-1 / pkcs-1v2-1d2.asn < prev    next >
Text File  |  2014-05-02  |  8KB  |  268 lines

  1. PKCS-1 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)  modules(0) pkcs-1(1)}
  2.  
  3. -- $Revision: 1.0 $
  4.  
  5. -- This module has been checked for conformance with the ASN.1 
  6. -- standard by the OSS ASN.1 Tools
  7.  
  8. DEFINITIONS EXPLICIT TAGS ::=
  9.  
  10. BEGIN
  11.  
  12. -- EXPORTS ALL --                                          
  13. -- All types and values defined in this module is exported for 
  14. -- use in other ASN.1 modules.
  15.  
  16. IMPORTS
  17.  
  18. id-sha256, id-sha384, id-sha512 
  19.     FROM NIST-SHA2 {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) 
  20.     nistalgorithm(4) modules (0) sha2 (1)};
  21.  
  22. -- Basic object identifiers 
  23.  
  24. -- The DER for this in hexadecimal is:
  25. -- 06 08 
  26. --      2A 86 48 86 F7 0D 01 01
  27. --
  28. pkcs-1 OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1}
  29.  
  30. --
  31. -- When the following OIDs are used in an AlgorithmIdentifier 
  32. -- the parameters MUST be present and MUST be NULL.
  33. --
  34. rsaEncryption            OBJECT IDENTIFIER ::= { pkcs-1 1 }
  35. md2WithRSAEncryption        OBJECT IDENTIFIER ::= { pkcs-1 2 }
  36. md4WithRSAEncryption        OBJECT IDENTIFIER ::= { pkcs-1 3 }
  37. md5WithRSAEncryption          OBJECT IDENTIFIER ::= { pkcs-1 4 }
  38. sha1WithRSAEncryption         OBJECT IDENTIFIER ::= { pkcs-1 5 }
  39. sha256WithRSAEncryption     OBJECT IDENTIFIER ::= { pkcs-1 11 }
  40. sha384WithRSAEncryption     OBJECT IDENTIFIER ::= { pkcs-1 12 }
  41. sha512WithRSAEncryption     OBJECT IDENTIFIER ::= { pkcs-1 13 }
  42.  
  43. rsaOAEPEncryptionSET           OBJECT IDENTIFIER ::= { pkcs-1 6 }
  44.  
  45. --
  46. -- When id-RSAES-OAEP is used in an AlgorithmIdentifier the 
  47. -- parameters MUST be present and MUST be RSAES-OAEP-params.
  48. --
  49. id-RSAES-OAEP                  OBJECT IDENTIFIER ::= { pkcs-1 7 }
  50.  
  51. --
  52. -- When id-mgf1 is used in an AlgorithmIdentifier the parameters 
  53. -- MUST be present and MUST be a DigestAlgorithmIdentifier, for 
  54. -- example SHA1Identifier.
  55. --
  56. id-mgf1                        OBJECT IDENTIFIER ::= { pkcs-1 8 }
  57.  
  58. --
  59. -- When id-pSpecified is used in an AlgorithmIdentifier the 
  60. -- parameters MUST be an OCTET STRING.
  61. --
  62. id-pSpecified             OBJECT IDENTIFIER ::= { pkcs-1 9 }
  63.  
  64. --
  65. -- When id-RSASSA-PSS is used in an AlgorithmIdentifier the 
  66. -- parameters MUST be present and MUST be RSASSA-PSS-params.
  67. --
  68. id-RSASSA-PSS                  OBJECT IDENTIFIER ::= { pkcs-1 10 }
  69.  
  70. --
  71. -- This OID really belongs in a module with the secsig OIDs.
  72. --
  73. id-sha1                        OBJECT IDENTIFIER ::= 
  74.     {iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 }
  75.  
  76. -- Useful types
  77.  
  78. ALGORITHM-IDENTIFIER ::= TYPE-IDENTIFIER
  79.  
  80. -- Note: the parameter InfoObjectSet in the following 
  81. -- definitions allows a distinct information object
  82. -- set to be specified for sets of algorithms such as:  
  83. -- DigestAlgorithms         ALGORITHM-IDENTIFIER ::= {
  84. --      { NULL IDENTIFIED BY id-md2 },
  85. --      { NULL IDENTIFIED BY id-md5 },
  86. --      { NULL IDENTIFIED BY id-sha1 }
  87. --     }
  88. --
  89.  
  90. AlgorithmIdentifier { ALGORITHM-IDENTIFIER:InfoObjectSet } ::= SEQUENCE {
  91.     algorithm    ALGORITHM-IDENTIFIER.&id({InfoObjectSet}),
  92.     parameters    ALGORITHM-IDENTIFIER.&Type({InfoObjectSet} {@algorithm}) OPTIONAL
  93.     }
  94.  
  95. -- Algorithms
  96.  
  97. --
  98. -- Allowed OAEP digest algorithms.
  99. --
  100. OAEP-PSSDigestAlgorithms     ALGORITHM-IDENTIFIER ::= {
  101.     { SHAParameters IDENTIFIED BY id-sha1 }     |
  102.     { SHAParameters IDENTIFIED BY id-sha256 }     |
  103.     { SHAParameters IDENTIFIED BY id-sha384 }     |
  104.     { SHAParameters IDENTIFIED BY id-sha512 },
  105.      ... -- Allows for future expansion
  106.     }
  107.  
  108. sha1Identifier AlgorithmIdentifier {{ OAEP-PSSDigestAlgorithms }} ::= 
  109.     {algorithm id-sha1, parameters SHAParameters : NULL}
  110.  
  111. SHAParameters ::= NULL
  112.  
  113. --
  114. -- Allowed Mask Generation Function algorithms.
  115. -- If the identifier is id-mgf1, the parameters
  116. -- are a single digest algorithm identifier.
  117. --
  118. PKCS1MGFAlgorithms         ALGORITHM-IDENTIFIER ::= {
  119.     { MGF1Parameters IDENTIFIED BY id-mgf1 },
  120.     ...-- Allows for future expansion
  121.     }
  122.  
  123. MGF1Parameters ::= AlgorithmIdentifier { {OAEP-PSSDigestAlgorithms} }
  124.  
  125. --
  126. -- Allowed algorithms for pSourceFunc.
  127. --
  128. PKCS1PSourceAlgorithms     ALGORITHM-IDENTIFIER ::= {
  129.     { PEmptyString IDENTIFIED BY id-pSpecified },
  130.     ...-- Allows for future expansion
  131.     }
  132.  
  133. PEmptyString ::= OCTET STRING (SIZE(0))
  134.  
  135. -- 
  136. -- This identifier means that P is an empty string, so the digest
  137. -- of the empty string appears in the RSA block before masking.
  138. --
  139. pSpecifiedEmptyIdentifier AlgorithmIdentifier {{ PKCS1PSourceAlgorithms }} ::=
  140.     { algorithm id-pSpecified, parameters PEmptyString : ''H }
  141.  
  142. --
  143. -- Default AlgorithmIdentifier for id-RSAES-OAEP.maskGenFunc.
  144. --
  145. mgf1SHA1Identifier AlgorithmIdentifier {{ PKCS1MGFAlgorithms }} ::=
  146.     {algorithm id-mgf1, 
  147.     parameters AlgorithmIdentifier{{OAEP-PSSDigestAlgorithms}} : sha1Identifier}
  148.  
  149. --
  150. -- Type identifier definitions for the PKCS #1 OIDs.
  151. --
  152. PKCS1Algorithms     ALGORITHM-IDENTIFIER ::= {
  153.     { NULL IDENTIFIED BY rsaEncryption }                   |
  154.     { NULL IDENTIFIED BY md2WithRSAEncryption }            |
  155.     { NULL IDENTIFIED BY md4WithRSAEncryption }            |
  156.     { NULL IDENTIFIED BY md5WithRSAEncryption }            |
  157.     { NULL IDENTIFIED BY sha1WithRSAEncryption }           |
  158.     { NULL IDENTIFIED BY sha256WithRSAEncryption }         |
  159.     { NULL IDENTIFIED BY sha384WithRSAEncryption }         |
  160.     { NULL IDENTIFIED BY sha512WithRSAEncryption }         |
  161.     { NULL IDENTIFIED BY rsaOAEPEncryptionSET }            |
  162.     { RSAES-OAEP-params IDENTIFIED BY id-RSAES-OAEP }     | 
  163.     PKCS1PSourceAlgorithms                              |
  164.     { RSASSA-PSS-params IDENTIFIED BY id-RSASSA-PSS },
  165.     ... -- Allows for future expansion
  166.     }
  167.  
  168. -- Main structures
  169.  
  170. RSAPublicKey ::= SEQUENCE {
  171.     modulus             INTEGER, -- n
  172.     publicExponent        INTEGER  -- e 
  173.     }
  174.  
  175. -- 
  176. -- Representation of RSA private key with information for the 
  177. -- CRT algorithm.
  178. --
  179. RSAPrivateKey ::= SEQUENCE {
  180.     version              Version,
  181.     modulus              INTEGER, -- (Usually large) n
  182.     publicExponent       INTEGER, -- (Usually small) e
  183.     privateExponent      INTEGER, -- (Usually large) d
  184.     prime1               INTEGER, -- (Usually large) p
  185.     prime2               INTEGER, -- (Usually large) q
  186.     exponent1            INTEGER, -- (Usually large) d mod (p-1)
  187.     exponent2            INTEGER, -- (Usually large) d mod (q-1)
  188.     coefficient          INTEGER, -- (Usually large) (inverse of q) mod p
  189.     otherPrimeInfos     OtherPrimeInfos OPTIONAL
  190.     }
  191.  
  192. Version ::= INTEGER { two-prime(0), multi(1) }
  193.     (CONSTRAINED BY {-- version must be multi if otherPrimeInfos present --})
  194.  
  195. OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo
  196.  
  197. OtherPrimeInfo ::= SEQUENCE {
  198.     prime INTEGER,  -- ri
  199.     exponent INTEGER, -- di
  200.     coefficient INTEGER -- ti 
  201.     }
  202.  
  203. -- 
  204. -- AlgorithmIdentifier.parameters for id-RSAES-OAEP.
  205. -- Note that the tags in this Sequence are explicit.
  206. --
  207. RSAES-OAEP-params ::=  SEQUENCE { 
  208.     hashFunc        [0] AlgorithmIdentifier { {OAEP-PSSDigestAlgorithms} }
  209.                  DEFAULT sha1Identifier,
  210.     maskGenFunc    [1] AlgorithmIdentifier { {PKCS1MGFAlgorithms} }
  211.                  DEFAULT mgf1SHA1Identifier,
  212.     pSourceFunc    [2] AlgorithmIdentifier { {PKCS1PSourceAlgorithms} } 
  213.                  DEFAULT pSpecifiedEmptyIdentifier
  214.     }
  215.  
  216. -- 
  217. -- Identifier for default RSAES-OAEP algorithm identifier
  218. -- The DER Encoding of this is in hexadecimal:
  219. -- 30 0D
  220. --      06 09 
  221. --           2A 86 48 86 F7 0D 01 01 07
  222. --      30 00   
  223. --           Notice that the DER encoding of default values 
  224. --           is "empty". 
  225. --
  226.  
  227. rSAES-OAEP-Default-Identifier AlgorithmIdentifier{ {PKCS1Algorithms} } ::= 
  228.     {algorithm id-RSAES-OAEP,
  229.     parameters RSAES-OAEP-params : {
  230.         hashFunc        sha1Identifier, 
  231.         maskGenFunc     mgf1SHA1Identifier,
  232.         pSourceFunc     pSpecifiedEmptyIdentifier
  233.         }
  234.     }
  235.  
  236.  
  237. -- 
  238. -- AlgorithmIdentifier.parameters for id-RSASSA-PSS.
  239. -- Note that the tags in this Sequence are explicit.
  240. --
  241. RSASSA-PSS-params ::=  SEQUENCE {
  242.     hashFunc     [0] AlgorithmIdentifier {{OAEP-PSSDigestAlgorithms}}
  243.                  DEFAULT sha1Identifier,
  244.     maskGenFunc    [1] AlgorithmIdentifier {{PKCS1MGFAlgorithms}}
  245.                  DEFAULT mgf1SHA1Identifier 
  246.     }
  247.  
  248. -- 
  249. -- Identifier for default RSASSA-PSS algorithm identifier
  250. -- The DER Encoding of this is in hexadecimal:
  251. -- 30 0D
  252. --      06 09 
  253. --           2A 86 48 86 F7 0D 01 01 0A
  254. --      30 00   
  255. --           Notice that the DER encoding of default values 
  256. --           is "empty". 
  257. --
  258. rSASSA-PSS-Default-Identifier AlgorithmIdentifier{ {PKCS1Algorithms} } ::= 
  259.     {algorithm id-RSASSA-PSS,
  260.     parameters RSASSA-PSS-params : {
  261.         hashFunc        sha1Identifier, 
  262.         maskGenFunc     mgf1SHA1Identifier
  263.         }
  264.     }
  265.  
  266. END -- PKCS1Definitions
  267.  
  268.