1 | /* $Id: rsa-template.h 69111 2017-10-17 14:26:02Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Crypto - RSA, Code Generator Template.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #define RTASN1TMPL_DECL RTDECL
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * RSA public key.
|
---|
31 | */
|
---|
32 | #define RTASN1TMPL_TYPE RTCRRSAPUBLICKEY
|
---|
33 | #define RTASN1TMPL_EXT_NAME RTCrRsaPublicKey
|
---|
34 | #define RTASN1TMPL_INT_NAME rtCrRsaPublicKey
|
---|
35 | RTASN1TMPL_BEGIN_SEQCORE();
|
---|
36 | RTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
|
---|
37 | RTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
|
---|
38 | RTASN1TMPL_END_SEQCORE();
|
---|
39 | #undef RTASN1TMPL_TYPE
|
---|
40 | #undef RTASN1TMPL_EXT_NAME
|
---|
41 | #undef RTASN1TMPL_INT_NAME
|
---|
42 |
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * One RSA other prime info.
|
---|
46 | */
|
---|
47 | #define RTASN1TMPL_TYPE RTCRRSAOTHERPRIMEINFO
|
---|
48 | #define RTASN1TMPL_EXT_NAME RTCrRsaOtherPrimeInfo
|
---|
49 | #define RTASN1TMPL_INT_NAME rtCrRsaOtherPrimeInfo
|
---|
50 | RTASN1TMPL_BEGIN_SEQCORE();
|
---|
51 | RTASN1TMPL_MEMBER( Prime, RTASN1INTEGER, RTAsn1Integer);
|
---|
52 | RTASN1TMPL_MEMBER( Exponent, RTASN1INTEGER, RTAsn1Integer);
|
---|
53 | RTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
|
---|
54 | RTASN1TMPL_END_SEQCORE();
|
---|
55 | #undef RTASN1TMPL_TYPE
|
---|
56 | #undef RTASN1TMPL_EXT_NAME
|
---|
57 | #undef RTASN1TMPL_INT_NAME
|
---|
58 |
|
---|
59 |
|
---|
60 | /*
|
---|
61 | * Sequence of RSA other prime infos.
|
---|
62 | */
|
---|
63 | #define RTASN1TMPL_TYPE RTCRRSAOTHERPRIMEINFOS
|
---|
64 | #define RTASN1TMPL_EXT_NAME RTCrRsaOtherPrimeInfos
|
---|
65 | #define RTASN1TMPL_INT_NAME rtCrRsaOtherPrimeInfos
|
---|
66 | RTASN1TMPL_SEQ_OF(RTCRRSAOTHERPRIMEINFO, RTCrRsaOtherPrimeInfo);
|
---|
67 | #undef RTASN1TMPL_TYPE
|
---|
68 | #undef RTASN1TMPL_EXT_NAME
|
---|
69 | #undef RTASN1TMPL_INT_NAME
|
---|
70 |
|
---|
71 |
|
---|
72 | /*
|
---|
73 | * RSA private key.
|
---|
74 | */
|
---|
75 | #define RTASN1TMPL_TYPE RTCRRSAPRIVATEKEY
|
---|
76 | #define RTASN1TMPL_EXT_NAME RTCrRsaPrivateKey
|
---|
77 | #define RTASN1TMPL_INT_NAME rtCrRsaPrivateKey
|
---|
78 | RTASN1TMPL_BEGIN_SEQCORE();
|
---|
79 | RTASN1TMPL_MEMBER( Version, RTASN1INTEGER, RTAsn1Integer);
|
---|
80 | RTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
|
---|
81 | RTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
|
---|
82 | RTASN1TMPL_MEMBER( PrivateExponent, RTASN1INTEGER, RTAsn1Integer);
|
---|
83 | RTASN1TMPL_MEMBER( Prime1, RTASN1INTEGER, RTAsn1Integer);
|
---|
84 | RTASN1TMPL_MEMBER( Prime2, RTASN1INTEGER, RTAsn1Integer);
|
---|
85 | RTASN1TMPL_MEMBER( Exponent1, RTASN1INTEGER, RTAsn1Integer);
|
---|
86 | RTASN1TMPL_MEMBER( Exponent2, RTASN1INTEGER, RTAsn1Integer);
|
---|
87 | RTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
|
---|
88 | RTASN1TMPL_MEMBER_OPT_ITAG_EX( OtherPrimeInfos, RTCRRSAOTHERPRIMEINFOS, RTCrRsaOtherPrimeInfos, ASN1_TAG_SEQUENCE, RTASN1TMPL_ITAG_F_UC, RT_NOTHING);
|
---|
89 | RTASN1TMPL_END_SEQCORE();
|
---|
90 | #undef RTASN1TMPL_TYPE
|
---|
91 | #undef RTASN1TMPL_EXT_NAME
|
---|
92 | #undef RTASN1TMPL_INT_NAME
|
---|
93 |
|
---|
94 |
|
---|
95 | /*
|
---|
96 | * RSA Digest Info.
|
---|
97 | */
|
---|
98 | #define RTASN1TMPL_TYPE RTCRRSADIGESTINFO
|
---|
99 | #define RTASN1TMPL_EXT_NAME RTCrRsaDigestInfo
|
---|
100 | #define RTASN1TMPL_INT_NAME rtCrRsaDigestInfo
|
---|
101 | RTASN1TMPL_BEGIN_SEQCORE();
|
---|
102 | RTASN1TMPL_MEMBER( DigestAlgorithm, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
|
---|
103 | RTASN1TMPL_MEMBER( Digest, RTASN1OCTETSTRING, RTAsn1OctetString);
|
---|
104 | RTASN1TMPL_END_SEQCORE();
|
---|
105 | #undef RTASN1TMPL_TYPE
|
---|
106 | #undef RTASN1TMPL_EXT_NAME
|
---|
107 | #undef RTASN1TMPL_INT_NAME
|
---|
108 |
|
---|