From de06767b384cd5056a540b196337a23d7b125fd3 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 26 Aug 2014 10:49:35 +0700 Subject: Cleanup obsolete code warnings --- crypto/src/openssl/PEMReader.cs | 2 +- crypto/src/security/PrivateKeyFactory.cs | 3 +-- crypto/test/src/crypto/test/OAEPTest.cs | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crypto/src/openssl/PEMReader.cs b/crypto/src/openssl/PEMReader.cs index 9d3560838..8c19fe601 100644 --- a/crypto/src/openssl/PEMReader.cs +++ b/crypto/src/openssl/PEMReader.cs @@ -276,7 +276,7 @@ namespace Org.BouncyCastle.OpenSsl if (seq.Count != 9) throw new PemException("malformed sequence in RSA private key"); - RsaPrivateKeyStructure rsa = new RsaPrivateKeyStructure(seq); + RsaPrivateKeyStructure rsa = RsaPrivateKeyStructure.GetInstance(seq); pubSpec = new RsaKeyParameters(false, rsa.Modulus, rsa.PublicExponent); privSpec = new RsaPrivateCrtKeyParameters( diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs index 1cfa37afe..edc5ef85a 100644 --- a/crypto/src/security/PrivateKeyFactory.cs +++ b/crypto/src/security/PrivateKeyFactory.cs @@ -53,8 +53,7 @@ namespace Org.BouncyCastle.Security || algOid.Equals(PkcsObjectIdentifiers.IdRsassaPss) || algOid.Equals(PkcsObjectIdentifiers.IdRsaesOaep)) { - RsaPrivateKeyStructure keyStructure = new RsaPrivateKeyStructure( - Asn1Sequence.GetInstance(keyInfo.ParsePrivateKey())); + RsaPrivateKeyStructure keyStructure = RsaPrivateKeyStructure.GetInstance(keyInfo.ParsePrivateKey()); return new RsaPrivateCrtKeyParameters( keyStructure.Modulus, diff --git a/crypto/test/src/crypto/test/OAEPTest.cs b/crypto/test/src/crypto/test/OAEPTest.cs index b4c375eec..ee48a183d 100644 --- a/crypto/test/src/crypto/test/OAEPTest.cs +++ b/crypto/test/src/crypto/test/OAEPTest.cs @@ -315,8 +315,8 @@ namespace Org.BouncyCastle.Crypto.Tests // extract the private key info. // Asn1Object privKeyObj = Asn1Object.FromByteArray(privKeyEnc); - RsaPrivateKeyStructure privStruct = new RsaPrivateKeyStructure( - (Asn1Sequence)PrivateKeyInfo.GetInstance(privKeyObj).ParsePrivateKey()); + RsaPrivateKeyStructure privStruct = RsaPrivateKeyStructure.GetInstance( + PrivateKeyInfo.GetInstance(privKeyObj).ParsePrivateKey()); RsaKeyParameters pubParameters = new RsaKeyParameters( false, -- cgit 1.4.1