diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-10 19:42:21 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-10 19:42:21 +0700 |
commit | 218a170ece285fd49f82326c752a3d0fb31881dd (patch) | |
tree | 2a680d86ba2786e758f0fc9c845691f55ffe0553 /crypto | |
parent | Fix IV check for 64-bit blockSize (diff) | |
download | BouncyCastle.NET-ed25519-218a170ece285fd49f82326c752a3d0fb31881dd.tar.xz |
Address various compiler warnings
Diffstat (limited to 'crypto')
48 files changed, 96 insertions, 106 deletions
diff --git a/crypto/src/asn1/ess/OtherCertID.cs b/crypto/src/asn1/ess/OtherCertID.cs index 972ef8c6b..3d221b0ec 100644 --- a/crypto/src/asn1/ess/OtherCertID.cs +++ b/crypto/src/asn1/ess/OtherCertID.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Asn1.Oiw; using Org.BouncyCastle.Asn1.X509; namespace Org.BouncyCastle.Asn1.Ess @@ -78,7 +79,7 @@ namespace Org.BouncyCastle.Asn1.Ess if (otherCertHash.ToAsn1Object() is Asn1OctetString) { // SHA-1 - return new AlgorithmIdentifier("1.3.14.3.2.26"); + return new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1); } return DigestInfo.GetInstance(otherCertHash).AlgorithmID; diff --git a/crypto/src/asn1/pkcs/EncryptionScheme.cs b/crypto/src/asn1/pkcs/EncryptionScheme.cs index 5b64d6f67..ff9103d12 100644 --- a/crypto/src/asn1/pkcs/EncryptionScheme.cs +++ b/crypto/src/asn1/pkcs/EncryptionScheme.cs @@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs public override Asn1Object ToAsn1Object() { - return new DerSequence(ObjectID, Parameters); + return new DerSequence(Algorithm, Parameters); } } } diff --git a/crypto/src/cms/CMSAuthenticatedData.cs b/crypto/src/cms/CMSAuthenticatedData.cs index 5e234da2b..33b4cc22c 100644 --- a/crypto/src/cms/CMSAuthenticatedData.cs +++ b/crypto/src/cms/CMSAuthenticatedData.cs @@ -83,7 +83,7 @@ namespace Org.BouncyCastle.Cms */ public string MacAlgOid { - get { return macAlg.ObjectID.Id; } + get { return macAlg.Algorithm.Id; } } /** diff --git a/crypto/src/cms/CMSAuthenticatedDataParser.cs b/crypto/src/cms/CMSAuthenticatedDataParser.cs index c99aac61c..7defafc07 100644 --- a/crypto/src/cms/CMSAuthenticatedDataParser.cs +++ b/crypto/src/cms/CMSAuthenticatedDataParser.cs @@ -111,7 +111,7 @@ namespace Org.BouncyCastle.Cms */ public string MacAlgOid { - get { return macAlg.ObjectID.Id; } + get { return macAlg.Algorithm.Id; } } diff --git a/crypto/src/cms/CMSAuthenticatedDataStreamGenerator.cs b/crypto/src/cms/CMSAuthenticatedDataStreamGenerator.cs index a135cdd11..4d18d10d4 100644 --- a/crypto/src/cms/CMSAuthenticatedDataStreamGenerator.cs +++ b/crypto/src/cms/CMSAuthenticatedDataStreamGenerator.cs @@ -165,7 +165,7 @@ namespace Org.BouncyCastle.Cms Stream octetOutputStream = CmsUtilities.CreateBerOctetOutputStream( eiGen.GetRawOutputStream(), 0, false, _bufferSize); - IMac mac = MacUtilities.GetMac(macAlgId.ObjectID); + IMac mac = MacUtilities.GetMac(macAlgId.Algorithm); // TODO Confirm no ParametersWithRandom needed mac.Init(cipherParameters); Stream mOut = new TeeOutputStream(octetOutputStream, new MacOutputStream(mac)); diff --git a/crypto/src/cms/CMSEnvelopedData.cs b/crypto/src/cms/CMSEnvelopedData.cs index 0731c307e..223d0ca73 100644 --- a/crypto/src/cms/CMSEnvelopedData.cs +++ b/crypto/src/cms/CMSEnvelopedData.cs @@ -73,7 +73,7 @@ namespace Org.BouncyCastle.Cms */ public string EncryptionAlgOid { - get { return encAlg.ObjectID.Id; } + get { return encAlg.Algorithm.Id; } } /** diff --git a/crypto/src/cms/CMSEnvelopedDataParser.cs b/crypto/src/cms/CMSEnvelopedDataParser.cs index 01a949d47..d5dfaf53d 100644 --- a/crypto/src/cms/CMSEnvelopedDataParser.cs +++ b/crypto/src/cms/CMSEnvelopedDataParser.cs @@ -101,7 +101,7 @@ namespace Org.BouncyCastle.Cms */ public string EncryptionAlgOid { - get { return _encAlg.ObjectID.Id; } + get { return _encAlg.Algorithm.Id; } } /** diff --git a/crypto/src/cms/CMSEnvelopedDataStreamGenerator.cs b/crypto/src/cms/CMSEnvelopedDataStreamGenerator.cs index bde8d9926..8e6d2729b 100644 --- a/crypto/src/cms/CMSEnvelopedDataStreamGenerator.cs +++ b/crypto/src/cms/CMSEnvelopedDataStreamGenerator.cs @@ -166,7 +166,7 @@ namespace Org.BouncyCastle.Cms Stream octetOutputStream = CmsUtilities.CreateBerOctetOutputStream( eiGen.GetRawOutputStream(), 0, false, _bufferSize); - IBufferedCipher cipher = CipherUtilities.GetCipher(encAlgID.ObjectID); + IBufferedCipher cipher = CipherUtilities.GetCipher(encAlgID.Algorithm); cipher.Init(true, new ParametersWithRandom(cipherParameters, rand)); CipherStream cOut = new CipherStream(octetOutputStream, null, cipher); diff --git a/crypto/src/cms/CMSEnvelopedHelper.cs b/crypto/src/cms/CMSEnvelopedHelper.cs index fe2b14cd9..77d2da47a 100644 --- a/crypto/src/cms/CMSEnvelopedHelper.cs +++ b/crypto/src/cms/CMSEnvelopedHelper.cs @@ -160,7 +160,7 @@ namespace Org.BouncyCastle.Cms public CmsReadable GetReadable(KeyParameter sKey) { - string macAlg = this.algorithm.ObjectID.Id; + string macAlg = this.algorithm.Algorithm.Id; // Asn1Object sParams = this.algorithm.Parameters.ToAsn1Object(); try @@ -190,11 +190,11 @@ namespace Org.BouncyCastle.Cms // if (asn1Params != null && !(asn1Params is Asn1Null)) // { // cipherParameters = ParameterUtilities.GetCipherParameters( -// macAlg.ObjectID, cipherParameters, asn1Params); +// macAlg.Algorithm, cipherParameters, asn1Params); // } // else // { -// string alg = macAlg.ObjectID.Id; +// string alg = macAlg.Algorithm.Id; // if (alg.Equals(CmsEnvelopedDataGenerator.DesEde3Cbc) // || alg.Equals(CmsEnvelopedDataGenerator.IdeaCbc) // || alg.Equals(CmsEnvelopedDataGenerator.Cast5Cbc)) @@ -258,7 +258,7 @@ namespace Org.BouncyCastle.Cms { try { - this.cipher = CipherUtilities.GetCipher(this.algorithm.ObjectID); + this.cipher = CipherUtilities.GetCipher(this.algorithm.Algorithm); Asn1Encodable asn1Enc = this.algorithm.Parameters; Asn1Object asn1Params = asn1Enc == null ? null : asn1Enc.ToAsn1Object(); @@ -268,11 +268,11 @@ namespace Org.BouncyCastle.Cms if (asn1Params != null && !(asn1Params is Asn1Null)) { cipherParameters = ParameterUtilities.GetCipherParameters( - this.algorithm.ObjectID, cipherParameters, asn1Params); + this.algorithm.Algorithm, cipherParameters, asn1Params); } else { - string alg = this.algorithm.ObjectID.Id; + string alg = this.algorithm.Algorithm.Id; if (alg.Equals(CmsEnvelopedDataGenerator.DesEde3Cbc) || alg.Equals(CmsEnvelopedDataGenerator.IdeaCbc) || alg.Equals(CmsEnvelopedDataGenerator.Cast5Cbc)) diff --git a/crypto/src/cms/CMSPBEKey.cs b/crypto/src/cms/CMSPBEKey.cs index cb1e54c36..e03307e57 100644 --- a/crypto/src/cms/CMSPBEKey.cs +++ b/crypto/src/cms/CMSPBEKey.cs @@ -50,9 +50,9 @@ namespace Org.BouncyCastle.Cms char[] password, AlgorithmIdentifier keyDerivationAlgorithm) { - if (!keyDerivationAlgorithm.ObjectID.Equals(PkcsObjectIdentifiers.IdPbkdf2)) + if (!keyDerivationAlgorithm.Algorithm.Equals(PkcsObjectIdentifiers.IdPbkdf2)) throw new ArgumentException("Unsupported key derivation algorithm: " - + keyDerivationAlgorithm.ObjectID); + + keyDerivationAlgorithm.Algorithm); Pbkdf2Params kdfParams = Pbkdf2Params.GetInstance( keyDerivationAlgorithm.Parameters.ToAsn1Object()); diff --git a/crypto/src/cms/CMSSignedData.cs b/crypto/src/cms/CMSSignedData.cs index 81c87a426..237c1528e 100644 --- a/crypto/src/cms/CMSSignedData.cs +++ b/crypto/src/cms/CMSSignedData.cs @@ -172,7 +172,7 @@ namespace Org.BouncyCastle.Cms } else { - byte[] hash = (byte[]) hashes[info.DigestAlgorithm.ObjectID.Id]; + byte[] hash = (byte[])hashes[info.DigestAlgorithm.Algorithm.Id]; signerInfos.Add(new SignerInformation(info, contentType, null, new BaseDigestCalculator(hash))); } diff --git a/crypto/src/cms/CMSSignedDataParser.cs b/crypto/src/cms/CMSSignedDataParser.cs index e5e6edc58..fb51ab119 100644 --- a/crypto/src/cms/CMSSignedDataParser.cs +++ b/crypto/src/cms/CMSSignedDataParser.cs @@ -122,7 +122,7 @@ namespace Org.BouncyCastle.Cms try { - string digestOid = id.ObjectID.Id; + string digestOid = id.Algorithm.Id; string digestName = Helper.GetDigestAlgName(digestOid); if (!this._digests.Contains(digestName)) @@ -216,7 +216,7 @@ namespace Org.BouncyCastle.Cms { SignerInfo info = SignerInfo.GetInstance(o.ToAsn1Object()); string digestName = Helper.GetDigestAlgName( - info.DigestAlgorithm.ObjectID.Id); + info.DigestAlgorithm.Algorithm.Id); byte[] hash = (byte[]) hashes[digestName]; diff --git a/crypto/src/cms/CMSSignedDataStreamGenerator.cs b/crypto/src/cms/CMSSignedDataStreamGenerator.cs index 1477d884f..d0ab7428a 100644 --- a/crypto/src/cms/CMSSignedDataStreamGenerator.cs +++ b/crypto/src/cms/CMSSignedDataStreamGenerator.cs @@ -459,7 +459,7 @@ namespace Org.BouncyCastle.Cms // NB: Would need to call FixAlgID on the DigestAlgorithmID // For precalculated signers, just need to register the algorithm, not configure a digest - RegisterDigestOid(si.DigestAlgorithmID.ObjectID.Id); + RegisterDigestOid(si.DigestAlgorithmID.Algorithm.Id); } /** diff --git a/crypto/src/cms/CMSSignedHelper.cs b/crypto/src/cms/CMSSignedHelper.cs index 23657ef86..5b6c93b6a 100644 --- a/crypto/src/cms/CMSSignedHelper.cs +++ b/crypto/src/cms/CMSSignedHelper.cs @@ -348,7 +348,7 @@ namespace Org.BouncyCastle.Cms AlgorithmIdentifier algId) { if (algId.Parameters == null) - return new AlgorithmIdentifier(algId.ObjectID, DerNull.Instance); + return new AlgorithmIdentifier(algId.Algorithm, DerNull.Instance); return algId; } diff --git a/crypto/src/cms/KEKRecipientInfoGenerator.cs b/crypto/src/cms/KEKRecipientInfoGenerator.cs index a9bedade6..c66f27547 100644 --- a/crypto/src/cms/KEKRecipientInfoGenerator.cs +++ b/crypto/src/cms/KEKRecipientInfoGenerator.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Cms { byte[] keyBytes = contentEncryptionKey.GetKey(); - IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.ObjectID.Id); + IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id); keyWrapper.Init(true, new ParametersWithRandom(keyEncryptionKey, random)); Asn1OctetString encryptedKey = new DerOctetString( keyWrapper.Wrap(keyBytes, 0, keyBytes.Length)); diff --git a/crypto/src/cms/KEKRecipientInformation.cs b/crypto/src/cms/KEKRecipientInformation.cs index f960197d6..871dc76d4 100644 --- a/crypto/src/cms/KEKRecipientInformation.cs +++ b/crypto/src/cms/KEKRecipientInformation.cs @@ -40,7 +40,7 @@ namespace Org.BouncyCastle.Cms try { byte[] encryptedKey = info.EncryptedKey.GetOctets(); - IWrapper keyWrapper = WrapperUtilities.GetWrapper(keyEncAlg.ObjectID.Id); + IWrapper keyWrapper = WrapperUtilities.GetWrapper(keyEncAlg.Algorithm.Id); keyWrapper.Init(false, key); diff --git a/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs b/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs index 4fafb7c6e..6bd2cea91 100644 --- a/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs +++ b/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Cms { SubjectPublicKeyInfo spki = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey); return new OriginatorPublicKey( - new AlgorithmIdentifier(spki.AlgorithmID.ObjectID, DerNull.Instance), + new AlgorithmIdentifier(spki.AlgorithmID.Algorithm, DerNull.Instance), spki.PublicKeyData.GetBytes()); } } diff --git a/crypto/src/cms/KeyAgreeRecipientInformation.cs b/crypto/src/cms/KeyAgreeRecipientInformation.cs index 8e006e545..73e57a76a 100644 --- a/crypto/src/cms/KeyAgreeRecipientInformation.cs +++ b/crypto/src/cms/KeyAgreeRecipientInformation.cs @@ -130,7 +130,7 @@ namespace Org.BouncyCastle.Cms AsymmetricKeyParameter senderPublicKey, AsymmetricKeyParameter receiverPrivateKey) { - DerObjectIdentifier agreeAlgID = keyEncAlg.ObjectID; + DerObjectIdentifier agreeAlgID = keyEncAlg.Algorithm; ICipherParameters senderPublicParams = senderPublicKey; ICipherParameters receiverPrivateParams = receiverPrivateKey; diff --git a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs index 0992e6da6..a1d8fbfa8 100644 --- a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs +++ b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs @@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Cms byte[] keyBytes = contentEncryptionKey.GetKey(); AlgorithmIdentifier keyEncryptionAlgorithm = info.AlgorithmID; - IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.ObjectID.Id); + IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id); keyWrapper.Init(true, new ParametersWithRandom(recipientPublicKey, random)); byte[] encryptedKeyBytes = keyWrapper.Wrap(keyBytes, 0, keyBytes.Length); diff --git a/crypto/src/cms/KeyTransRecipientInformation.cs b/crypto/src/cms/KeyTransRecipientInformation.cs index 24121cb2c..3b1ea7b5e 100644 --- a/crypto/src/cms/KeyTransRecipientInformation.cs +++ b/crypto/src/cms/KeyTransRecipientInformation.cs @@ -68,7 +68,7 @@ namespace Org.BouncyCastle.Cms internal KeyParameter UnwrapKey(ICipherParameters key) { byte[] encryptedKey = info.EncryptedKey.GetOctets(); - string keyExchangeAlgorithm = GetExchangeEncryptionAlgorithmName(keyEncAlg.ObjectID); + string keyExchangeAlgorithm = GetExchangeEncryptionAlgorithmName(keyEncAlg.Algorithm); try { diff --git a/crypto/src/cms/RecipientInformation.cs b/crypto/src/cms/RecipientInformation.cs index 8b0316be4..272b841f2 100644 --- a/crypto/src/cms/RecipientInformation.cs +++ b/crypto/src/cms/RecipientInformation.cs @@ -33,8 +33,8 @@ namespace Org.BouncyCastle.Cms internal string GetContentAlgorithmName() { AlgorithmIdentifier algorithm = secureReadable.Algorithm; -// return CmsEnvelopedHelper.Instance.GetSymmetricCipherName(algorithm.ObjectID.Id); - return algorithm.ObjectID.Id; +// return CmsEnvelopedHelper.Instance.GetSymmetricCipherName(algorithm.Algorithm.Id); + return algorithm.Algorithm.Id; } public RecipientID RecipientID @@ -54,7 +54,7 @@ namespace Org.BouncyCastle.Cms */ public string KeyEncryptionAlgOid { - get { return keyEncAlg.ObjectID.Id; } + get { return keyEncAlg.Algorithm.Id; } } /** diff --git a/crypto/src/cms/SignerInformation.cs b/crypto/src/cms/SignerInformation.cs index 581286a3f..dad128263 100644 --- a/crypto/src/cms/SignerInformation.cs +++ b/crypto/src/cms/SignerInformation.cs @@ -117,7 +117,7 @@ namespace Org.BouncyCastle.Cms */ public string DigestAlgOid { - get { return digestAlgorithm.ObjectID.Id; } + get { return digestAlgorithm.Algorithm.Id; } } /** @@ -156,7 +156,7 @@ namespace Org.BouncyCastle.Cms */ public string EncryptionAlgOid { - get { return encryptionAlgorithm.ObjectID.Id; } + get { return encryptionAlgorithm.Algorithm.Id; } } /** @@ -272,7 +272,7 @@ namespace Org.BouncyCastle.Cms */ SignerInfo si = SignerInfo.GetInstance(asn1Obj.ToAsn1Object()); - string digestName = CmsSignedHelper.Instance.GetDigestAlgName(si.DigestAlgorithm.ObjectID.Id); + string digestName = CmsSignedHelper.Instance.GetDigestAlgName(si.DigestAlgorithm.Algorithm.Id); counterSignatures.Add(new SignerInformation(si, null, null, new CounterSignatureDigestCalculator(digestName, GetSignature()))); } @@ -298,7 +298,7 @@ namespace Org.BouncyCastle.Cms string digestName = Helper.GetDigestAlgName(this.DigestAlgOid); IDigest digest = Helper.GetDigestInstance(digestName); - DerObjectIdentifier sigAlgOid = this.encryptionAlgorithm.ObjectID; + DerObjectIdentifier sigAlgOid = this.encryptionAlgorithm.Algorithm; Asn1Encodable sigParams = this.encryptionAlgorithm.Parameters; ISigner sig; @@ -318,12 +318,12 @@ namespace Org.BouncyCastle.Cms Asn1.Pkcs.RsassaPssParameters pss = Asn1.Pkcs.RsassaPssParameters.GetInstance( sigParams.ToAsn1Object()); - if (!pss.HashAlgorithm.ObjectID.Equals(this.digestAlgorithm.ObjectID)) + if (!pss.HashAlgorithm.Algorithm.Equals(this.digestAlgorithm.Algorithm)) throw new CmsException("RSASSA-PSS signature parameters specified incorrect hash algorithm"); - if (!pss.MaskGenAlgorithm.ObjectID.Equals(Asn1.Pkcs.PkcsObjectIdentifiers.IdMgf1)) + if (!pss.MaskGenAlgorithm.Algorithm.Equals(Asn1.Pkcs.PkcsObjectIdentifiers.IdMgf1)) throw new CmsException("RSASSA-PSS signature parameters specified unknown MGF"); - IDigest pssDigest = DigestUtilities.GetDigest(pss.HashAlgorithm.ObjectID); + IDigest pssDigest = DigestUtilities.GetDigest(pss.HashAlgorithm.Algorithm); int saltLength = pss.SaltLength.Value.IntValue; byte trailerField = (byte) pss.TrailerField.Value.IntValue; @@ -532,7 +532,7 @@ namespace Org.BouncyCastle.Cms DigestInfo digInfo = DerDecode(decrypt); - if (!digInfo.AlgorithmID.ObjectID.Equals(digestAlgorithm.ObjectID)) + if (!digInfo.AlgorithmID.Algorithm.Equals(digestAlgorithm.Algorithm)) { return false; } diff --git a/crypto/src/crypto/operators/Asn1Signature.cs b/crypto/src/crypto/operators/Asn1Signature.cs index 3a20e4bff..e023c1d18 100644 --- a/crypto/src/crypto/operators/Asn1Signature.cs +++ b/crypto/src/crypto/operators/Asn1Signature.cs @@ -170,13 +170,13 @@ namespace Org.BouncyCastle.Crypto.Operators if (parameters != null && !derNull.Equals(parameters)) { - if (sigAlgId.ObjectID.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) { RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(parameters); - return GetDigestAlgName(rsaParams.HashAlgorithm.ObjectID) + "withRSAandMGF1"; + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; } - if (sigAlgId.ObjectID.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) + if (sigAlgId.Algorithm.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) { Asn1Sequence ecDsaParams = Asn1Sequence.GetInstance(parameters); @@ -184,7 +184,7 @@ namespace Org.BouncyCastle.Crypto.Operators } } - return sigAlgId.ObjectID.Id; + return sigAlgId.Algorithm.Id; } private static RsassaPssParameters CreatePssParams( diff --git a/crypto/src/ocsp/BasicOCSPResp.cs b/crypto/src/ocsp/BasicOCSPResp.cs index dec3b0bc5..63ab8921e 100644 --- a/crypto/src/ocsp/BasicOCSPResp.cs +++ b/crypto/src/ocsp/BasicOCSPResp.cs @@ -95,12 +95,12 @@ namespace Org.BouncyCastle.Ocsp public string SignatureAlgName { - get { return OcspUtilities.GetAlgorithmName(resp.SignatureAlgorithm.ObjectID); } + get { return OcspUtilities.GetAlgorithmName(resp.SignatureAlgorithm.Algorithm); } } public string SignatureAlgOid { - get { return resp.SignatureAlgorithm.ObjectID.Id; } + get { return resp.SignatureAlgorithm.Algorithm.Id; } } [Obsolete("RespData class is no longer required as all functionality is available on this class")] diff --git a/crypto/src/ocsp/CertificateID.cs b/crypto/src/ocsp/CertificateID.cs index a8f035759..ec902d5c3 100644 --- a/crypto/src/ocsp/CertificateID.cs +++ b/crypto/src/ocsp/CertificateID.cs @@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Ocsp public string HashAlgOid { - get { return id.HashAlgorithm.ObjectID.Id; } + get { return id.HashAlgorithm.Algorithm.Id; } } public byte[] GetIssuerNameHash() @@ -118,7 +118,7 @@ namespace Org.BouncyCastle.Ocsp { try { - String hashAlgorithm = hashAlg.ObjectID.Id; + String hashAlgorithm = hashAlg.Algorithm.Id; X509Name issuerName = PrincipalUtilities.GetSubjectX509Principal(issuerCert); byte[] issuerNameHash = DigestUtilities.CalculateDigest( diff --git a/crypto/src/ocsp/OCSPReq.cs b/crypto/src/ocsp/OCSPReq.cs index 29e8cc015..0cd95c6d6 100644 --- a/crypto/src/ocsp/OCSPReq.cs +++ b/crypto/src/ocsp/OCSPReq.cs @@ -144,7 +144,7 @@ namespace Org.BouncyCastle.Ocsp if (!this.IsSigned) return null; - return req.OptionalSignature.SignatureAlgorithm.ObjectID.Id; + return req.OptionalSignature.SignatureAlgorithm.Algorithm.Id; } } diff --git a/crypto/src/openssl/MiscPemGenerator.cs b/crypto/src/openssl/MiscPemGenerator.cs index 6b91e8b1c..568465fe4 100644 --- a/crypto/src/openssl/MiscPemGenerator.cs +++ b/crypto/src/openssl/MiscPemGenerator.cs @@ -218,7 +218,7 @@ namespace Org.BouncyCastle.OpenSsl { PrivateKeyInfo info = PrivateKeyInfoFactory.CreatePrivateKeyInfo(akp); AlgorithmIdentifier algID = info.PrivateKeyAlgorithm; - DerObjectIdentifier oid = algID.ObjectID; + DerObjectIdentifier oid = algID.Algorithm; if (oid.Equals(X9ObjectIdentifiers.IdDsa)) { diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs index 633a57ebe..0411d9190 100644 --- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs +++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs @@ -402,14 +402,14 @@ namespace Org.BouncyCastle.Pkcs if (asn1Params != null && !(asn1Params is Asn1Null)) { - if (sigAlgId.ObjectID.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) { RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(asn1Params); - return GetDigestAlgName(rsaParams.HashAlgorithm.ObjectID) + "withRSAandMGF1"; + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; } } - return sigAlgId.ObjectID.Id; + return sigAlgId.Algorithm.Id; } private static string GetDigestAlgName( diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs index e4fe29401..b649a726e 100644 --- a/crypto/src/pkcs/Pkcs12Store.cs +++ b/crypto/src/pkcs/Pkcs12Store.cs @@ -213,7 +213,7 @@ namespace Org.BouncyCastle.Pkcs byte[] data = ((Asn1OctetString) info.Content).GetOctets(); - byte[] mac = CalculatePbeMac(algId.ObjectID, salt, itCount, password, false, data); + byte[] mac = CalculatePbeMac(algId.Algorithm, salt, itCount, password, false, data); byte[] dig = dInfo.GetDigest(); if (!Arrays.ConstantTimeAreEqual(mac, dig)) @@ -222,7 +222,7 @@ namespace Org.BouncyCastle.Pkcs throw new IOException("PKCS12 key store MAC invalid - wrong password or corrupted file."); // Try with incorrect zero length password - mac = CalculatePbeMac(algId.ObjectID, salt, itCount, password, true, data); + mac = CalculatePbeMac(algId.Algorithm, salt, itCount, password, true, data); if (!Arrays.ConstantTimeAreEqual(mac, dig)) throw new IOException("PKCS12 key store MAC invalid - wrong password or corrupted file."); @@ -1015,14 +1015,14 @@ namespace Org.BouncyCastle.Pkcs bool wrongPkcs12Zero, byte[] data) { - IBufferedCipher cipher = PbeUtilities.CreateEngine(algId.ObjectID) as IBufferedCipher; + IBufferedCipher cipher = PbeUtilities.CreateEngine(algId.Algorithm) as IBufferedCipher; if (cipher == null) - throw new Exception("Unknown encryption algorithm: " + algId.ObjectID); + throw new Exception("Unknown encryption algorithm: " + algId.Algorithm); Pkcs12PbeParams pbeParameters = Pkcs12PbeParams.GetInstance(algId.Parameters); ICipherParameters cipherParams = PbeUtilities.GenerateCipherParameters( - algId.ObjectID, password, wrongPkcs12Zero, pbeParameters); + algId.Algorithm, password, wrongPkcs12Zero, pbeParameters); cipher.Init(forEncryption, cipherParams); return cipher.DoFinal(data); } diff --git a/crypto/src/pkcs/Pkcs12Utilities.cs b/crypto/src/pkcs/Pkcs12Utilities.cs index d35c8b6a2..923eca5a5 100644 --- a/crypto/src/pkcs/Pkcs12Utilities.cs +++ b/crypto/src/pkcs/Pkcs12Utilities.cs @@ -56,10 +56,10 @@ namespace Org.BouncyCastle.Pkcs int itCount = mData.IterationCount.IntValue; byte[] data = Asn1OctetString.GetInstance(info.Content).GetOctets(); byte[] res = Pkcs12Store.CalculatePbeMac( - mData.Mac.AlgorithmID.ObjectID, mData.GetSalt(), itCount, passwd, false, data); + mData.Mac.AlgorithmID.Algorithm, mData.GetSalt(), itCount, passwd, false, data); AlgorithmIdentifier algId = new AlgorithmIdentifier( - mData.Mac.AlgorithmID.ObjectID, DerNull.Instance); + mData.Mac.AlgorithmID.Algorithm, DerNull.Instance); DigestInfo dInfo = new DigestInfo(algId, res); mData = new MacData(dInfo, mData.GetSalt(), itCount); diff --git a/crypto/src/pkcs/PrivateKeyInfoFactory.cs b/crypto/src/pkcs/PrivateKeyInfoFactory.cs index 723d50f08..c6aab4884 100644 --- a/crypto/src/pkcs/PrivateKeyInfoFactory.cs +++ b/crypto/src/pkcs/PrivateKeyInfoFactory.cs @@ -195,7 +195,7 @@ namespace Org.BouncyCastle.Pkcs IBufferedCipher cipher = PbeUtilities.CreateEngine(algID) as IBufferedCipher; if (cipher == null) - throw new Exception("Unknown encryption algorithm: " + algID.ObjectID); + throw new Exception("Unknown encryption algorithm: " + algID.Algorithm); ICipherParameters cipherParameters = PbeUtilities.GenerateCipherParameters( algID, passPhrase, wrongPkcs12Zero); diff --git a/crypto/src/pkix/PkixCertPathValidator.cs b/crypto/src/pkix/PkixCertPathValidator.cs index 7eb838886..fcfa63837 100644 --- a/crypto/src/pkix/PkixCertPathValidator.cs +++ b/crypto/src/pkix/PkixCertPathValidator.cs @@ -204,7 +204,7 @@ namespace Org.BouncyCastle.Pkix "Algorithm identifier of public key of trust anchor could not be read.", e, certPath, -1); } -// DerObjectIdentifier workingPublicKeyAlgorithm = workingAlgId.ObjectID; +// DerObjectIdentifier workingPublicKeyAlgorithm = workingAlgId.Algorithm; // Asn1Encodable workingPublicKeyParameters = workingAlgId.Parameters; // @@ -358,7 +358,7 @@ namespace Org.BouncyCastle.Pkix workingAlgId = PkixCertPathValidatorUtilities.GetAlgorithmIdentifier(workingPublicKey); // (f) -// workingPublicKeyAlgorithm = workingAlgId.ObjectID; +// workingPublicKeyAlgorithm = workingAlgId.Algorithm; // (e) // workingPublicKeyParameters = workingAlgId.Parameters; } diff --git a/crypto/src/security/PbeUtilities.cs b/crypto/src/security/PbeUtilities.cs index 56d68ba0a..0cb235ae6 100644 --- a/crypto/src/security/PbeUtilities.cs +++ b/crypto/src/security/PbeUtilities.cs @@ -345,7 +345,7 @@ namespace Org.BouncyCastle.Security AlgorithmIdentifier algID, char[] password) { - return GenerateCipherParameters(algID.ObjectID.Id, password, false, algID.Parameters); + return GenerateCipherParameters(algID.Algorithm.Id, password, false, algID.Parameters); } public static ICipherParameters GenerateCipherParameters( @@ -353,7 +353,7 @@ namespace Org.BouncyCastle.Security char[] password, bool wrongPkcs12Zero) { - return GenerateCipherParameters(algID.ObjectID.Id, password, wrongPkcs12Zero, algID.Parameters); + return GenerateCipherParameters(algID.Algorithm.Id, password, wrongPkcs12Zero, algID.Parameters); } public static ICipherParameters GenerateCipherParameters( @@ -401,10 +401,10 @@ namespace Org.BouncyCastle.Security { PbeS2Parameters s2p = PbeS2Parameters.GetInstance(pbeParameters.ToAsn1Object()); AlgorithmIdentifier encScheme = s2p.EncryptionScheme; - DerObjectIdentifier encOid = encScheme.ObjectID; + DerObjectIdentifier encOid = encScheme.Algorithm; Asn1Object encParams = encScheme.Parameters.ToAsn1Object(); - // TODO What about s2p.KeyDerivationFunc.ObjectID? + // TODO What about s2p.KeyDerivationFunc.Algorithm? Pbkdf2Params pbeParams = Pbkdf2Params.GetInstance(s2p.KeyDerivationFunc.Parameters.ToAsn1Object()); byte[] iv; @@ -577,13 +577,13 @@ namespace Org.BouncyCastle.Security public static object CreateEngine( AlgorithmIdentifier algID) { - string algorithm = algID.ObjectID.Id; + string algorithm = algID.Algorithm.Id; if (IsPkcs5Scheme2(algorithm)) { PbeS2Parameters s2p = PbeS2Parameters.GetInstance(algID.Parameters.ToAsn1Object()); AlgorithmIdentifier encScheme = s2p.EncryptionScheme; - return CipherUtilities.GetCipher(encScheme.ObjectID); + return CipherUtilities.GetCipher(encScheme.Algorithm); } return CreateEngine(algorithm); diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs index edc5ef85a..b9538b33d 100644 --- a/crypto/src/security/PrivateKeyFactory.cs +++ b/crypto/src/security/PrivateKeyFactory.cs @@ -45,7 +45,7 @@ namespace Org.BouncyCastle.Security PrivateKeyInfo keyInfo) { AlgorithmIdentifier algID = keyInfo.PrivateKeyAlgorithm; - DerObjectIdentifier algOid = algID.ObjectID; + DerObjectIdentifier algOid = algID.Algorithm; // TODO See RSAUtil.isRsaOid in Java build if (algOid.Equals(PkcsObjectIdentifiers.RsaEncryption) diff --git a/crypto/src/security/PublicKeyFactory.cs b/crypto/src/security/PublicKeyFactory.cs index 8c0be4f70..f1b28b774 100644 --- a/crypto/src/security/PublicKeyFactory.cs +++ b/crypto/src/security/PublicKeyFactory.cs @@ -44,7 +44,7 @@ namespace Org.BouncyCastle.Security SubjectPublicKeyInfo keyInfo) { AlgorithmIdentifier algID = keyInfo.AlgorithmID; - DerObjectIdentifier algOid = algID.ObjectID; + DerObjectIdentifier algOid = algID.Algorithm; // TODO See RSAUtil.isRsaOid in Java build if (algOid.Equals(PkcsObjectIdentifiers.RsaEncryption) diff --git a/crypto/src/tsp/TimeStampRequest.cs b/crypto/src/tsp/TimeStampRequest.cs index 6b9699379..f54d33e04 100644 --- a/crypto/src/tsp/TimeStampRequest.cs +++ b/crypto/src/tsp/TimeStampRequest.cs @@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Tsp public string MessageImprintAlgOid { - get { return req.MessageImprint.HashAlgorithm.ObjectID.Id; } + get { return req.MessageImprint.HashAlgorithm.Algorithm.Id; } } public byte[] GetMessageImprintDigest() diff --git a/crypto/src/tsp/TimeStampToken.cs b/crypto/src/tsp/TimeStampToken.cs index 51a9592dc..105208a7d 100644 --- a/crypto/src/tsp/TimeStampToken.cs +++ b/crypto/src/tsp/TimeStampToken.cs @@ -271,10 +271,10 @@ namespace Org.BouncyCastle.Tsp if (certID != null) return "SHA-1"; - if (NistObjectIdentifiers.IdSha256.Equals(certIDv2.HashAlgorithm.ObjectID)) + if (NistObjectIdentifiers.IdSha256.Equals(certIDv2.HashAlgorithm.Algorithm)) return "SHA-256"; - return certIDv2.HashAlgorithm.ObjectID.Id; + return certIDv2.HashAlgorithm.Algorithm.Id; } public AlgorithmIdentifier GetHashAlgorithm() diff --git a/crypto/src/tsp/TimeStampTokenInfo.cs b/crypto/src/tsp/TimeStampTokenInfo.cs index 5027a87c4..cdef826bc 100644 --- a/crypto/src/tsp/TimeStampTokenInfo.cs +++ b/crypto/src/tsp/TimeStampTokenInfo.cs @@ -86,7 +86,7 @@ namespace Org.BouncyCastle.Tsp public string MessageImprintAlgOid { - get { return tstInfo.MessageImprint.HashAlgorithm.ObjectID.Id; } + get { return tstInfo.MessageImprint.HashAlgorithm.Algorithm.Id; } } public byte[] GetMessageImprintDigest() diff --git a/crypto/src/x509/AttributeCertificateHolder.cs b/crypto/src/x509/AttributeCertificateHolder.cs index 3a6af4c20..04460cd59 100644 --- a/crypto/src/x509/AttributeCertificateHolder.cs +++ b/crypto/src/x509/AttributeCertificateHolder.cs @@ -103,7 +103,7 @@ namespace Org.BouncyCastle.X509 // TODO Allow 'objectDigest' to be null? holder = new Holder(new ObjectDigestInfo(digestedObjectType, otherObjectTypeID, - new AlgorithmIdentifier(digestAlgorithm), Arrays.Clone(objectDigest))); + new AlgorithmIdentifier(new DerObjectIdentifier(digestAlgorithm)), Arrays.Clone(objectDigest))); } /** @@ -147,7 +147,7 @@ namespace Org.BouncyCastle.X509 return odi == null ? null - : odi.DigestAlgorithm.ObjectID.Id; + : odi.DigestAlgorithm.Algorithm.Id; } } diff --git a/crypto/src/x509/X509Certificate.cs b/crypto/src/x509/X509Certificate.cs index 472ef7308..6d7bd7a61 100644 --- a/crypto/src/x509/X509Certificate.cs +++ b/crypto/src/x509/X509Certificate.cs @@ -246,7 +246,7 @@ namespace Org.BouncyCastle.X509 /// <returns>A sting representing the signature algorithm.</returns> public virtual string SigAlgName { - get { return SignerUtilities.GetEncodingName(c.SignatureAlgorithm.ObjectID); } + get { return SignerUtilities.GetEncodingName(c.SignatureAlgorithm.Algorithm); } } /// <summary> @@ -255,7 +255,7 @@ namespace Org.BouncyCastle.X509 /// <returns>A string containg a '.' separated object id.</returns> public virtual string SigAlgOid { - get { return c.SignatureAlgorithm.ObjectID.Id; } + get { return c.SignatureAlgorithm.Algorithm.Id; } } /// <summary> @@ -586,7 +586,7 @@ namespace Org.BouncyCastle.X509 private static bool IsAlgIDEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) { - if (!id1.ObjectID.Equals(id2.ObjectID)) + if (!id1.Algorithm.Equals(id2.Algorithm)) return false; Asn1Encodable p1 = id1.Parameters; diff --git a/crypto/src/x509/X509Crl.cs b/crypto/src/x509/X509Crl.cs index ee564dacb..ecfb14132 100644 --- a/crypto/src/x509/X509Crl.cs +++ b/crypto/src/x509/X509Crl.cs @@ -221,7 +221,7 @@ namespace Org.BouncyCastle.X509 public virtual string SigAlgOid { - get { return c.SignatureAlgorithm.ObjectID.Id; } + get { return c.SignatureAlgorithm.Algorithm.Id; } } public virtual byte[] GetSigAlgParams() diff --git a/crypto/src/x509/X509SignatureUtil.cs b/crypto/src/x509/X509SignatureUtil.cs index 7a4ab1448..858b8f446 100644 --- a/crypto/src/x509/X509SignatureUtil.cs +++ b/crypto/src/x509/X509SignatureUtil.cs @@ -55,13 +55,13 @@ namespace Org.BouncyCastle.X509 if (parameters != null && !derNull.Equals(parameters)) { - if (sigAlgId.ObjectID.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) { RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(parameters); - return GetDigestAlgName(rsaParams.HashAlgorithm.ObjectID) + "withRSAandMGF1"; + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; } - if (sigAlgId.ObjectID.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) + if (sigAlgId.Algorithm.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) { Asn1Sequence ecDsaParams = Asn1Sequence.GetInstance(parameters); @@ -69,7 +69,7 @@ namespace Org.BouncyCastle.X509 } } - return sigAlgId.ObjectID.Id; + return sigAlgId.Algorithm.Id; } /** diff --git a/crypto/test/src/asn1/test/BitStringTest.cs b/crypto/test/src/asn1/test/BitStringTest.cs index fccaf8fa0..05be45941 100644 --- a/crypto/test/src/asn1/test/BitStringTest.cs +++ b/crypto/test/src/asn1/test/BitStringTest.cs @@ -31,12 +31,8 @@ namespace Org.BouncyCastle.Asn1.Tests new DerBitString(null, 1); Fail("exception not thrown"); } - catch (ArgumentNullException e) + catch (ArgumentNullException) { - //if (!"data cannot be null".Equals(e.Message)) - //{ - // Fail("Unexpected exception"); - //} } try @@ -44,12 +40,8 @@ namespace Org.BouncyCastle.Asn1.Tests new DerBitString(new byte[0], 1); Fail("exception not thrown"); } - catch (ArgumentException e) + catch (ArgumentException) { - //if (!"zero length data with non-zero pad bits".Equals(e.Message)) - //{ - // Fail("Unexpected exception"); - //} } try @@ -57,12 +49,8 @@ namespace Org.BouncyCastle.Asn1.Tests new DerBitString(new byte[1], 8); Fail("exception not thrown"); } - catch (ArgumentException e) + catch (ArgumentException) { - //if (!"pad bits cannot be greater than 7 or less than 0".Equals(e.Message)) - //{ - // Fail("Unexpected exception"); - //} } DerBitString s2 = new DerBitString(0); diff --git a/crypto/test/src/asn1/test/LDSSecurityObjectUnitTest.cs b/crypto/test/src/asn1/test/LDSSecurityObjectUnitTest.cs index 042781632..914eda0b8 100644 --- a/crypto/test/src/asn1/test/LDSSecurityObjectUnitTest.cs +++ b/crypto/test/src/asn1/test/LDSSecurityObjectUnitTest.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.Icao; +using Org.BouncyCastle.Asn1.Oiw; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; using Org.BouncyCastle.Utilities.Test; @@ -29,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Tests public override void PerformTest() { - AlgorithmIdentifier algoId = new AlgorithmIdentifier("1.3.14.3.2.26"); + AlgorithmIdentifier algoId = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1); DataGroupHash[] datas = new DataGroupHash[2]; datas[0] = new DataGroupHash(1, new DerOctetString(GenerateHash())); diff --git a/crypto/test/src/crypto/test/Pkcs5Test.cs b/crypto/test/src/crypto/test/Pkcs5Test.cs index 8066e8e41..fdf1e7a66 100644 --- a/crypto/test/src/crypto/test/Pkcs5Test.cs +++ b/crypto/test/src/crypto/test/Pkcs5Test.cs @@ -115,7 +115,7 @@ namespace Org.BouncyCastle.Crypto.Tests generator.Init(PbeParametersGenerator.Pkcs5PasswordToBytes(password), salt, iterationCount); - DerObjectIdentifier algOid = scheme.ObjectID; + DerObjectIdentifier algOid = scheme.Algorithm; byte[] iv; if (algOid.Equals(PkcsObjectIdentifiers.RC2Cbc)) diff --git a/crypto/test/src/pkcs/test/PKCS12StoreTest.cs b/crypto/test/src/pkcs/test/PKCS12StoreTest.cs index c6b39135e..cd9dfcfad 100644 --- a/crypto/test/src/pkcs/test/PKCS12StoreTest.cs +++ b/crypto/test/src/pkcs/test/PKCS12StoreTest.cs @@ -837,7 +837,7 @@ namespace Org.BouncyCastle.Pkcs.Tests EncryptedPrivateKeyInfo encInfo = EncryptedPrivateKeyInfo.GetInstance(sb.BagValue); // check the key encryption - if (!encInfo.EncryptionAlgorithm.ObjectID.Equals(keyAlgorithm)) + if (!encInfo.EncryptionAlgorithm.Algorithm.Equals(keyAlgorithm)) { Fail("key encryption algorithm wrong"); } @@ -845,7 +845,7 @@ namespace Org.BouncyCastle.Pkcs.Tests // check the certificate encryption EncryptedData cb = EncryptedData.GetInstance(c2.Content); - if (!cb.EncryptionAlgorithm.ObjectID.Equals(certAlgorithm)) + if (!cb.EncryptionAlgorithm.Algorithm.Equals(certAlgorithm)) { Fail("cert encryption algorithm wrong"); } diff --git a/crypto/test/src/test/CertTest.cs b/crypto/test/src/test/CertTest.cs index 9bb4df7d1..72e17e458 100644 --- a/crypto/test/src/test/CertTest.cs +++ b/crypto/test/src/test/CertTest.cs @@ -2452,7 +2452,7 @@ namespace Org.BouncyCastle.Tests DerSequence seq = new DerSequence( tbsCertificate, - new AlgorithmIdentifier(sig.ObjectID), + new AlgorithmIdentifier(sig.Algorithm), certStruct.Signature); try diff --git a/crypto/test/src/test/PKCS10CertRequestTest.cs b/crypto/test/src/test/PKCS10CertRequestTest.cs index ba62db32f..9bad0a678 100644 --- a/crypto/test/src/test/PKCS10CertRequestTest.cs +++ b/crypto/test/src/test/PKCS10CertRequestTest.cs @@ -193,7 +193,7 @@ namespace Org.BouncyCastle.Tests Fail("Failed Verify check EC uncompressed encoded."); } - if (!req.SignatureAlgorithm.ObjectID.Equals(algOid)) + if (!req.SignatureAlgorithm.Algorithm.Equals(algOid)) { Fail("ECDSA oid incorrect."); } @@ -247,7 +247,7 @@ namespace Org.BouncyCastle.Tests Fail("Failed Verify check EC encoded."); } - if (!req.SignatureAlgorithm.ObjectID.Equals(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001)) + if (!req.SignatureAlgorithm.Algorithm.Equals(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001)) { Fail("ECGOST oid incorrect."); } @@ -308,7 +308,7 @@ namespace Org.BouncyCastle.Tests Fail("Failed verify check PSS encoded."); } - if (!req.SignatureAlgorithm.ObjectID.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + if (!req.SignatureAlgorithm.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) { Fail("PSS oid incorrect."); } |