222 tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)2),
223 tmp3);
224
225 // Put all together under a SEQUENCE tag
226 DerOutputStream out = new DerOutputStream();
227 out.write(DerValue.tag_Sequence, tmp);
228 return out.toByteArray();
229 }
230
231 protected byte[] engineGetEncoded(String encodingMethod)
232 throws IOException {
233 if ((encodingMethod != null) &&
234 (!encodingMethod.equalsIgnoreCase("ASN.1"))) {
235 throw new IllegalArgumentException("Only support ASN.1 format");
236 }
237 return engineGetEncoded();
238 }
239
240 protected String engineToString() {
241 StringBuilder sb = new StringBuilder();
242 sb.append("MD: " + mdName + "\n");
243 sb.append("MGF: MGF1" + mgfSpec.getDigestAlgorithm() + "\n");
244 sb.append("PSource: PSpecified " +
245 (p.length==0? "":Debug.toHexString(new BigInteger(p))) + "\n");
246 return sb.toString();
247 }
248 }
|
222 tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)2),
223 tmp3);
224
225 // Put all together under a SEQUENCE tag
226 DerOutputStream out = new DerOutputStream();
227 out.write(DerValue.tag_Sequence, tmp);
228 return out.toByteArray();
229 }
230
231 protected byte[] engineGetEncoded(String encodingMethod)
232 throws IOException {
233 if ((encodingMethod != null) &&
234 (!encodingMethod.equalsIgnoreCase("ASN.1"))) {
235 throw new IllegalArgumentException("Only support ASN.1 format");
236 }
237 return engineGetEncoded();
238 }
239
240 protected String engineToString() {
241 StringBuilder sb = new StringBuilder();
242 sb.append("MD: ").append(mdName).append('\n');
243 sb.append("MGF: MGF1").append(mgfSpec.getDigestAlgorithm())
244 .append('\n');
245 sb.append("PSource: PSpecified ")
246 .append(p.length == 0 ? "" : Debug
247 .toHexString(new BigInteger(p))).append('\n');
248 return sb.toString();
249 }
250 }
|