diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-26 00:46:51 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-26 00:46:51 +0700 |
commit | fe0347352da212319b6471a64ba42282b27bf3f7 (patch) | |
tree | eedaf2b61c16406991756775176e842f3db520bb /crypto/src/ocsp/OCSPReq.cs | |
parent | Fix PkixNameConstraintValidator method names (diff) | |
download | BouncyCastle.NET-ed25519-fe0347352da212319b6471a64ba42282b27bf3f7.tar.xz |
Avoid reparsing when possible
Diffstat (limited to '')
-rw-r--r-- | crypto/src/ocsp/OCSPReq.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/src/ocsp/OCSPReq.cs b/crypto/src/ocsp/OCSPReq.cs index cb2748780..194b6c9c7 100644 --- a/crypto/src/ocsp/OCSPReq.cs +++ b/crypto/src/ocsp/OCSPReq.cs @@ -165,9 +165,10 @@ namespace Org.BouncyCastle.Ocsp { foreach (Asn1Encodable ae in certs) { - if (ae != null && ae.ToAsn1Object() is Asn1Sequence s) + var c = X509CertificateStructure.GetInstance(ae); + if (c != null) { - result.Add(new X509Certificate(X509CertificateStructure.GetInstance(s))); + result.Add(new X509Certificate(c)); } } } |