VirtualBox

source: vbox/trunk/src/VBox/Runtime/common/crypto/rsa-template.h@ 73603

Last change on this file since 73603 was 69111, checked in by vboxsync, 7 years ago

(C) year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
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
35RTASN1TMPL_BEGIN_SEQCORE();
36RTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
37RTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
38RTASN1TMPL_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
50RTASN1TMPL_BEGIN_SEQCORE();
51RTASN1TMPL_MEMBER( Prime, RTASN1INTEGER, RTAsn1Integer);
52RTASN1TMPL_MEMBER( Exponent, RTASN1INTEGER, RTAsn1Integer);
53RTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
54RTASN1TMPL_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
66RTASN1TMPL_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
78RTASN1TMPL_BEGIN_SEQCORE();
79RTASN1TMPL_MEMBER( Version, RTASN1INTEGER, RTAsn1Integer);
80RTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
81RTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
82RTASN1TMPL_MEMBER( PrivateExponent, RTASN1INTEGER, RTAsn1Integer);
83RTASN1TMPL_MEMBER( Prime1, RTASN1INTEGER, RTAsn1Integer);
84RTASN1TMPL_MEMBER( Prime2, RTASN1INTEGER, RTAsn1Integer);
85RTASN1TMPL_MEMBER( Exponent1, RTASN1INTEGER, RTAsn1Integer);
86RTASN1TMPL_MEMBER( Exponent2, RTASN1INTEGER, RTAsn1Integer);
87RTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
88RTASN1TMPL_MEMBER_OPT_ITAG_EX( OtherPrimeInfos, RTCRRSAOTHERPRIMEINFOS, RTCrRsaOtherPrimeInfos, ASN1_TAG_SEQUENCE, RTASN1TMPL_ITAG_F_UC, RT_NOTHING);
89RTASN1TMPL_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
101RTASN1TMPL_BEGIN_SEQCORE();
102RTASN1TMPL_MEMBER( DigestAlgorithm, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
103RTASN1TMPL_MEMBER( Digest, RTASN1OCTETSTRING, RTAsn1OctetString);
104RTASN1TMPL_END_SEQCORE();
105#undef RTASN1TMPL_TYPE
106#undef RTASN1TMPL_EXT_NAME
107#undef RTASN1TMPL_INT_NAME
108
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette