diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-12 12:18:22 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-12 12:18:22 +0700 |
commit | 708aa28a814f8daa66b11d2efb31191f9a7f8696 (patch) | |
tree | 412acaa9d26552ac6ee19bc97058465ff8ca52c0 /crypto | |
parent | EdDSA: guard against pub key mismatch (diff) | |
download | BouncyCastle.NET-ed25519-708aa28a814f8daa66b11d2efb31191f9a7f8696.tar.xz |
Mark some constructors obsolete (per bc-java)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs | 3 | ||||
-rw-r--r-- | crypto/src/asn1/x9/X962Parameters.cs | 9 | ||||
-rw-r--r-- | crypto/src/security/PrivateKeyFactory.cs | 6 | ||||
-rw-r--r-- | crypto/src/security/PublicKeyFactory.cs | 2 |
4 files changed, 14 insertions, 6 deletions
diff --git a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs index 32a8fb226..c32025ef6 100644 --- a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs +++ b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs @@ -49,7 +49,8 @@ namespace Org.BouncyCastle.Asn1.CryptoPro this.encryptionParamSet = encryptionParamSet; } - public Gost3410PublicKeyAlgParameters( + [Obsolete("Use 'GetInstance' instead")] + public Gost3410PublicKeyAlgParameters( Asn1Sequence seq) { this.publicKeyParamSet = (DerObjectIdentifier) seq[0]; diff --git a/crypto/src/asn1/x9/X962Parameters.cs b/crypto/src/asn1/x9/X962Parameters.cs index 04a5c9cbe..5bdabc647 100644 --- a/crypto/src/asn1/x9/X962Parameters.cs +++ b/crypto/src/asn1/x9/X962Parameters.cs @@ -49,7 +49,14 @@ namespace Org.BouncyCastle.Asn1.X9 this._params = namedCurve; } - public X962Parameters( + public X962Parameters( + Asn1Null obj) + { + this._params = obj; + } + + [Obsolete("Use 'GetInstance' instead")] + public X962Parameters( Asn1Object obj) { this._params = obj; diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs index ddcb88992..b72ece365 100644 --- a/crypto/src/security/PrivateKeyFactory.cs +++ b/crypto/src/security/PrivateKeyFactory.cs @@ -107,7 +107,7 @@ namespace Org.BouncyCastle.Security } else if (algOid.Equals(X9ObjectIdentifiers.IdECPublicKey)) { - X962Parameters para = new X962Parameters(algID.Parameters.ToAsn1Object()); + X962Parameters para = X962Parameters.GetInstance(algID.Parameters.ToAsn1Object()); X9ECParameters x9; if (para.IsNamedCurve) @@ -132,8 +132,8 @@ namespace Org.BouncyCastle.Security } else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x2001)) { - Gost3410PublicKeyAlgParameters gostParams = new Gost3410PublicKeyAlgParameters( - Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); + Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance( + algID.Parameters.ToAsn1Object()); ECDomainParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet); diff --git a/crypto/src/security/PublicKeyFactory.cs b/crypto/src/security/PublicKeyFactory.cs index 7b19f1c0f..6813452a6 100644 --- a/crypto/src/security/PublicKeyFactory.cs +++ b/crypto/src/security/PublicKeyFactory.cs @@ -133,7 +133,7 @@ namespace Org.BouncyCastle.Security } else if (algOid.Equals(X9ObjectIdentifiers.IdECPublicKey)) { - X962Parameters para = new X962Parameters(algID.Parameters.ToAsn1Object()); + X962Parameters para = X962Parameters.GetInstance(algID.Parameters.ToAsn1Object()); X9ECParameters x9; if (para.IsNamedCurve) |