示例#1
0
 public virtual byte[] GetEncoded(X509Certificate checkCert, X509Certificate issuerCert, String url)
 {
     byte[] bytes = null;
     try {
         CertificateID id = SignTestPortUtil.GenerateCertificateId(issuerCert, checkCert.SerialNumber, Org.BouncyCastle.Ocsp.CertificateID.HashSha1
                                                                   );
         bytes = builder.MakeOcspResponse(SignTestPortUtil.GenerateOcspRequestWithNonce(id).GetEncoded(), caPrivateKey
                                          );
     }
     catch (Exception) {
     }
     return(bytes);
 }
示例#2
0
 public virtual byte[] GetEncoded(X509Certificate checkCert, X509Certificate issuerCert, String url)
 {
     byte[] bytes = null;
     try {
         CertificateID id = SignTestPortUtil.GenerateCertificateId(issuerCert, checkCert.SerialNumber, Org.BouncyCastle.Ocsp.CertificateID.HashSha1
                                                                   );
         TestOcspResponseBuilder builder = issuerIdToResponseBuilder.Get(issuerCert.SerialNumber.ToString(16));
         if (builder == null)
         {
             throw new ArgumentException("This TestOcspClient instance is not capable of providing OCSP response for the given issuerCert:"
                                         + issuerCert.SubjectDN.ToString());
         }
         bytes = builder.MakeOcspResponse(SignTestPortUtil.GenerateOcspRequestWithNonce(id).GetEncoded());
     }
     catch (Exception ignored) {
         if (ignored is Exception)
         {
             throw (Exception)ignored;
         }
     }
     return(bytes);
 }