rsa-template.h revision 13493ab7596e827b8d0caab2c89e635dd65f78f9
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/* $Id$ */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/** @file
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * IPRT - Crypto - RSA, Code Generator Template.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Copyright (C) 2006-2014 Oracle Corporation
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * available from http://www.virtualbox.org. This file is free software;
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * General Public License (GPL) as published by the Free Software
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * The contents of this file may alternatively be used under the terms
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * of the Common Development and Distribution License Version 1.0
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * VirtualBox OSE distribution, in which case the provisions of the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * CDDL are applicable instead of those of the GPL.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync *
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * You may elect to license modified versions of this file under the
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * terms and conditions of either the GPL or the CDDL or both.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_DECL RTDECL
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RSA public key.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_TYPE RTCRRSAPUBLICKEY
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_EXT_NAME RTCrRsaPublicKey
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_INT_NAME rtCrRsaPublicKey
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_BEGIN_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_END_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_TYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_EXT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_INT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * One RSA other prime info.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_TYPE RTCRRSAOTHERPRIMEINFO
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_EXT_NAME RTCrRsaOtherPrimeInfo
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_INT_NAME rtCrRsaOtherPrimeInfo
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_BEGIN_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Prime, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Exponent, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_END_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_TYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_EXT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_INT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Sequence of RSA other prime infos.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_TYPE RTCRRSAOTHERPRIMEINFOS
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_EXT_NAME RTCrRsaOtherPrimeInfos
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_INT_NAME rtCrRsaOtherPrimeInfos
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_SEQ_OF(RTCRRSAOTHERPRIMEINFO, RTCrRsaOtherPrimeInfo);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_TYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_EXT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_INT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RSA private key.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_TYPE RTCRRSAPRIVATEKEY
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_EXT_NAME RTCrRsaPrivateKey
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_INT_NAME rtCrRsaPrivateKey
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_BEGIN_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Version, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Modulus, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( PublicExponent, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( PrivateExponent, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Prime1, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Prime2, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Exponent1, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Exponent2, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Coefficient, RTASN1INTEGER, RTAsn1Integer);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER_OPT_ITAG_EX( OtherPrimeInfos, RTCRRSAOTHERPRIMEINFOS, RTCrRsaOtherPrimeInfos, ASN1_TAG_SEQUENCE, RTASN1TMPL_ITAG_F_UC, RT_NOTHING);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_END_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_TYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_EXT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_INT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync/*
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * RSA Digest Info.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync */
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_TYPE RTCRRSADIGESTINFO
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_EXT_NAME RTCrRsaDigestInfo
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#define RTASN1TMPL_INT_NAME rtCrRsaDigestInfo
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_BEGIN_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( DigestAlgorithm, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_MEMBER( Digest, RTASN1OCTETSTRING, RTAsn1OctetString);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTASN1TMPL_END_SEQCORE();
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_TYPE
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_EXT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync#undef RTASN1TMPL_INT_NAME
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync