diff options
Diffstat (limited to 'crypto/src/ocsp')
-rw-r--r-- | crypto/src/ocsp/BasicOCSPResp.cs | 21 | ||||
-rw-r--r-- | crypto/src/ocsp/OCSPReq.cs | 18 | ||||
-rw-r--r-- | crypto/src/ocsp/RespData.cs | 18 |
3 files changed, 15 insertions, 42 deletions
diff --git a/crypto/src/ocsp/BasicOCSPResp.cs b/crypto/src/ocsp/BasicOCSPResp.cs index 3e22931af..9986136ce 100644 --- a/crypto/src/ocsp/BasicOCSPResp.cs +++ b/crypto/src/ocsp/BasicOCSPResp.cs @@ -65,23 +65,12 @@ namespace Org.BouncyCastle.Ocsp get { return data.ProducedAt.ToDateTime(); } } - public SingleResp[] Responses - { - get - { - Asn1Sequence s = data.Responses; - SingleResp[] rs = new SingleResp[s.Count]; - - for (int i = 0; i != rs.Length; i++) - { - rs[i] = new SingleResp(SingleResponse.GetInstance(s[i])); - } - - return rs; - } - } + public SingleResp[] Responses + { + get { return data.Responses.MapElements(element => new SingleResp(SingleResponse.GetInstance(element))); } + } - public X509Extensions ResponseExtensions + public X509Extensions ResponseExtensions { get { return data.ResponseExtensions; } } diff --git a/crypto/src/ocsp/OCSPReq.cs b/crypto/src/ocsp/OCSPReq.cs index 194b6c9c7..51cb93b58 100644 --- a/crypto/src/ocsp/OCSPReq.cs +++ b/crypto/src/ocsp/OCSPReq.cs @@ -109,20 +109,12 @@ namespace Org.BouncyCastle.Ocsp get { return GeneralName.GetInstance(req.TbsRequest.RequestorName); } } - public Req[] GetRequestList() - { - Asn1Sequence seq = req.TbsRequest.RequestList; - Req[] requests = new Req[seq.Count]; - - for (int i = 0; i != requests.Length; i++) - { - requests[i] = new Req(Request.GetInstance(seq[i])); - } - - return requests; - } + public Req[] GetRequestList() + { + return req.TbsRequest.RequestList.MapElements(element => new Req(Request.GetInstance(element))); + } - public X509Extensions RequestExtensions + public X509Extensions RequestExtensions { get { return X509Extensions.GetInstance(req.TbsRequest.RequestExtensions); } } diff --git a/crypto/src/ocsp/RespData.cs b/crypto/src/ocsp/RespData.cs index 00de1cd59..e132c45b1 100644 --- a/crypto/src/ocsp/RespData.cs +++ b/crypto/src/ocsp/RespData.cs @@ -33,20 +33,12 @@ namespace Org.BouncyCastle.Ocsp get { return data.ProducedAt.ToDateTime(); } } - public SingleResp[] GetResponses() - { - Asn1Sequence s = data.Responses; - SingleResp[] rs = new SingleResp[s.Count]; - - for (int i = 0; i != rs.Length; i++) - { - rs[i] = new SingleResp(SingleResponse.GetInstance(s[i])); - } - - return rs; - } + public SingleResp[] GetResponses() + { + return data.Responses.MapElements(element => new SingleResp(SingleResponse.GetInstance(element))); + } - public X509Extensions ResponseExtensions + public X509Extensions ResponseExtensions { get { return data.ResponseExtensions; } } |