|
4 | 4 |
|
5 | 5 | using Org.BouncyCastle.Asn1;
|
6 | 6 | using Org.BouncyCastle.Asn1.CryptoPro;
|
| 7 | +using Org.BouncyCastle.Asn1.EdEC; |
7 | 8 | using Org.BouncyCastle.Asn1.Nist;
|
8 | 9 | using Org.BouncyCastle.Asn1.Oiw;
|
9 | 10 | using Org.BouncyCastle.Asn1.Pkcs;
|
| 11 | +using Org.BouncyCastle.Asn1.Rosstandart; |
10 | 12 | using Org.BouncyCastle.Asn1.TeleTrust;
|
11 | 13 | using Org.BouncyCastle.Asn1.X509;
|
12 | 14 | using Org.BouncyCastle.Asn1.X9;
|
@@ -52,8 +54,8 @@ public class Pkcs10CertificationRequest
|
52 | 54 | new Dictionary<string, Asn1Encodable>(StringComparer.OrdinalIgnoreCase);
|
53 | 55 | internal static readonly Dictionary<DerObjectIdentifier, string> m_keyAlgorithms =
|
54 | 56 | new Dictionary<DerObjectIdentifier, string>();
|
55 |
| - internal static readonly Dictionary<DerObjectIdentifier, string> m_oids = |
56 |
| - new Dictionary<DerObjectIdentifier, string>(); |
| 57 | + //internal static readonly Dictionary<DerObjectIdentifier, string> m_oids = |
| 58 | + // new Dictionary<DerObjectIdentifier, string>(); |
57 | 59 | internal static readonly HashSet<DerObjectIdentifier> m_noParams = new HashSet<DerObjectIdentifier>();
|
58 | 60 |
|
59 | 61 | static Pkcs10CertificationRequest()
|
@@ -120,33 +122,42 @@ static Pkcs10CertificationRequest()
|
120 | 122 | m_algorithms.Add("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001);
|
121 | 123 | m_algorithms.Add("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001);
|
122 | 124 | m_algorithms.Add("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001);
|
| 125 | + m_algorithms.Add("GOST3411-2012-256WITHECGOST3410", RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256); |
| 126 | + m_algorithms.Add("GOST3411-2012-256WITHECGOST3410-2012-256", RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256); |
| 127 | + m_algorithms.Add("GOST3411-2012-512WITHECGOST3410", RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_512); |
| 128 | + m_algorithms.Add("GOST3411-2012-512WITHECGOST3410-2012-512", RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_512); |
| 129 | + m_algorithms.Add("Ed25519", EdECObjectIdentifiers.id_Ed25519); |
| 130 | + m_algorithms.Add("Ed448", EdECObjectIdentifiers.id_Ed448); |
123 | 131 |
|
124 | 132 | //
|
125 | 133 | // reverse mappings
|
126 | 134 | //
|
127 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption, "SHA1WITHRSA"); |
128 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption, "SHA224WITHRSA"); |
129 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption, "SHA256WITHRSA"); |
130 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption, "SHA384WITHRSA"); |
131 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption, "SHA512WITHRSA"); |
132 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha512_224WithRSAEncryption, "SHA512(224)WITHRSA"); |
133 |
| - m_oids.Add(PkcsObjectIdentifiers.Sha512_256WithRSAEncryption, "SHA512(256)WITHRSA"); |
134 |
| - m_oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94, "GOST3411WITHGOST3410"); |
135 |
| - m_oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001, "GOST3411WITHECGOST3410"); |
136 |
| - |
137 |
| - m_oids.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5WITHRSA"); |
138 |
| - m_oids.Add(PkcsObjectIdentifiers.MD2WithRsaEncryption, "MD2WITHRSA"); |
139 |
| - m_oids.Add(X9ObjectIdentifiers.IdDsaWithSha1, "SHA1WITHDSA"); |
140 |
| - m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha1, "SHA1WITHECDSA"); |
141 |
| - m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha224, "SHA224WITHECDSA"); |
142 |
| - m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha256, "SHA256WITHECDSA"); |
143 |
| - m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha384, "SHA384WITHECDSA"); |
144 |
| - m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha512, "SHA512WITHECDSA"); |
145 |
| - m_oids.Add(OiwObjectIdentifiers.MD5WithRsa, "MD5WITHRSA"); |
146 |
| - m_oids.Add(OiwObjectIdentifiers.Sha1WithRsa, "SHA1WITHRSA"); |
147 |
| - m_oids.Add(OiwObjectIdentifiers.DsaWithSha1, "SHA1WITHDSA"); |
148 |
| - m_oids.Add(NistObjectIdentifiers.DsaWithSha224, "SHA224WITHDSA"); |
149 |
| - m_oids.Add(NistObjectIdentifiers.DsaWithSha256, "SHA256WITHDSA"); |
| 135 | + //m_oids.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption, "SHA1WITHRSA"); |
| 136 | + //m_oids.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption, "SHA224WITHRSA"); |
| 137 | + //m_oids.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption, "SHA256WITHRSA"); |
| 138 | + //m_oids.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption, "SHA384WITHRSA"); |
| 139 | + //m_oids.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption, "SHA512WITHRSA"); |
| 140 | + //m_oids.Add(PkcsObjectIdentifiers.Sha512_224WithRSAEncryption, "SHA512(224)WITHRSA"); |
| 141 | + //m_oids.Add(PkcsObjectIdentifiers.Sha512_256WithRSAEncryption, "SHA512(256)WITHRSA"); |
| 142 | + //m_oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94, "GOST3411WITHGOST3410"); |
| 143 | + //m_oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001, "GOST3411WITHECGOST3410"); |
| 144 | + |
| 145 | + //m_oids.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5WITHRSA"); |
| 146 | + //m_oids.Add(PkcsObjectIdentifiers.MD2WithRsaEncryption, "MD2WITHRSA"); |
| 147 | + //m_oids.Add(X9ObjectIdentifiers.IdDsaWithSha1, "SHA1WITHDSA"); |
| 148 | + //m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha1, "SHA1WITHECDSA"); |
| 149 | + //m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha224, "SHA224WITHECDSA"); |
| 150 | + //m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha256, "SHA256WITHECDSA"); |
| 151 | + //m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha384, "SHA384WITHECDSA"); |
| 152 | + //m_oids.Add(X9ObjectIdentifiers.ECDsaWithSha512, "SHA512WITHECDSA"); |
| 153 | + //m_oids.Add(OiwObjectIdentifiers.MD5WithRsa, "MD5WITHRSA"); |
| 154 | + //m_oids.Add(OiwObjectIdentifiers.Sha1WithRsa, "SHA1WITHRSA"); |
| 155 | + //m_oids.Add(OiwObjectIdentifiers.DsaWithSha1, "SHA1WITHDSA"); |
| 156 | + //m_oids.Add(NistObjectIdentifiers.DsaWithSha224, "SHA224WITHDSA"); |
| 157 | + //m_oids.Add(NistObjectIdentifiers.DsaWithSha256, "SHA256WITHDSA"); |
| 158 | + |
| 159 | + //m_oids.Add(EdECObjectIdentifiers.id_Ed25519, "Ed25519"); |
| 160 | + //m_oids.Add(EdECObjectIdentifiers.id_Ed448, "Ed448"); |
150 | 161 |
|
151 | 162 | //
|
152 | 163 | // key types
|
@@ -174,6 +185,12 @@ static Pkcs10CertificationRequest()
|
174 | 185 | m_noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94);
|
175 | 186 | m_noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001);
|
176 | 187 |
|
| 188 | + // |
| 189 | + // RFC 8410 |
| 190 | + // |
| 191 | + m_noParams.Add(EdECObjectIdentifiers.id_Ed25519); |
| 192 | + m_noParams.Add(EdECObjectIdentifiers.id_Ed448); |
| 193 | + |
177 | 194 | //
|
178 | 195 | // explicit params
|
179 | 196 | //
|
|
0 commit comments