x 509 root cerificate verification
I want to make x509 certificate root verification as manually. I used BouncyCastle Library. I added namespaces below
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.Utilities;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Security.Certificates;
using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.Utilities.Collections;
using Org.BouncyCastle.Utilities.Date;
using Org.BouncyCastle.Utilities.Encoders;
using Org.BouncyCastle.X509.Extension;
and I called method below开发者_JAVA百科
public static bool CertificateIssuerControl(X509Certificate2 certificate2Control, X509Certificate2 IssuerCertificate)
{
string signName = X509SignatureUtilities.GetSignatureName(certificate2Control.SignatureAlgorithm);
ISigner signature = SignerUtilities.GetSigner(signName);
return true;
}
and I take "The name 'X509SignatureUtilities' does not exist in the current context" error
How can I solve this error?
Thank you for any advice...
You are not in the right namespace. Include org/bouncycastle/jce/provider/X509SignatureUtil.java or wrap/prefix with
namespace Org.BouncyCastle.X509 {
...
}
and you should be fine.
Dw.
精彩评论