public String execute(byte[] args) { String id = SUtil.hex(args); return id; } };
public String execute(byte[] args) { String id = SUtil.hex(args); return id; } };
/** * Convert to hex value. */ public static String hex(byte[] data) { return SUtil.hex(data, false); }
/** * Convert a byte array to a string representation. */ public static String hex(byte[] data) { return hex(data, null, 1, true); }
/** * Convert a byte array to a string representation. */ public static String hex(byte[] data, boolean uppercase) { return hex(data, null, 1, uppercase); }
/** * Convert a byte array to a string representation. */ public static String hex(byte[] data, String delim, int block) { return hex(data, delim, block, true); }
/** * Get the digest of a message as a formatted String. */ public static String getHexMessageDigest(byte[] data, String type) { try { MessageDigest mdig = MessageDigest.getInstance(type); byte[] fp = mdig.digest(data); return SUtil.hex(fp, ":", 1); } catch(NoSuchAlgorithmException e) { throw new RuntimeException(e); } }
pp.createTextField("Subject", ""+xcert.getSubjectDN()); pp.createTextField("Issuer", ""+xcert.getIssuerDN()); pp.createTextField("Serial number", ""+SUtil.hex(xcert.getSerialNumber().toByteArray(), " ", 2)); pp.createTextField("Validity duration", SUtil.SDF.get().format(xcert.getNotBefore())+" - "+SUtil.SDF.get().format(xcert.getNotAfter())); pp.createTextField("Public key", key);
pp.createTextField("Subject", ""+xcert.getSubjectDN()); pp.createTextField("Issuer", ""+xcert.getIssuerDN()); pp.createTextField("Serial number", ""+SUtil.hex(xcert.getSerialNumber().toByteArray(), " ", 2)); pp.createTextField("Validity duration", SUtil.SDF.get().format(xcert.getNotBefore())+" - "+SUtil.SDF.get().format(xcert.getNotAfter())); pp.createTextField("Public key", key);