github sorted out confusion with patch...
import java.io.IOException;
import java.io.InputStream;
+import org.bouncycastle.asn1.ASN1Encodable;
+import org.bouncycastle.asn1.ASN1Encoding;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.DLSequence;
import org.bouncycastle.asn1.cmp.PKIFailureInfo;
@@ -214,6 +216,16 @@ else if (this.getStatus() == PKIStatus.GRANTED || this.getStatus() == PKIStatus.
*/
public byte[] getEncoded(String encoding) throws IOException
{
+ if (ASN1Encoding.DL.equals(encoding))
+ {
+ if (timeStampToken == null)
+ {
+ return new DLSequence(resp.getStatus()).getEncoded(encoding);
+ }
+
+ return new DLSequence(new ASN1Encodable[] { resp.getStatus(),
+ timeStampToken.toCMSSignedData().toASN1Structure() }).getEncoded(encoding);
+ }
return resp.getEncoded(encoding);
}
}
