private ITestResult Response() { try { OcspResponse resp = OcspResponse.GetInstance( Asn1Object.FromByteArray(_response)); ResponseBytes rBytes = ResponseBytes.GetInstance(resp.ResponseBytes); BasicOcspResponse bResp = BasicOcspResponse.GetInstance( Asn1Object.FromByteArray(rBytes.Response.GetOctets())); resp = new OcspResponse( resp.ResponseStatus, new ResponseBytes( rBytes.ResponseType, new DerOctetString(bResp.GetEncoded()))); if (!Arrays.AreEqual(resp.GetEncoded(), _response)) { return(new SimpleTestResult(false, Name + ": Ocsp response failed to re-encode")); } return(new SimpleTestResult(true, Name + ": Okay")); } catch (Exception e) { return(new SimpleTestResult(false, Name + ": failed response exception - " + e.ToString(), e)); } }
/** * return the ASN.1 encoded representation of this object. */ public byte[] GetEncoded() { return(resp.GetEncoded()); }