public static byte[] decode(byte[] in) { return decode(in, in.length); }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
/** * Verifies that the digests stored in the manifest match the decrypted * digests from the .SF file. This indicates the validity of the * signing, not the integrity of the file, as it's digest must be * calculated and verified when its contents are read. * * @throws SecurityException * if the digest value stored in the manifest does <i>not</i> * agree with the decrypted digest as recovered from the * <code>.SF</code> file. */ void verify() { byte[] d = digest.digest(); if (!MessageDigest.isEqual(d, Base64.decode(hash))) { throw invalidDigest(JarFile.MANIFEST_NAME, name, jarName); } verifiedEntries.put(name, certificates); }
@Override public void putByteArray(String key, byte[] value) { put(key, Base64.encode(value)); }
@Override public byte[] getByteArray(String key, byte[] deflt) { String svalue = get(key, null); if (svalue == null) { return deflt; } if (svalue.length() == 0) { return EmptyArray.BYTE; } try { byte[] bavalue = svalue.getBytes(StandardCharsets.US_ASCII); if (bavalue.length % 4 != 0) { return deflt; } return Base64.decode(bavalue); } catch (Exception e) { return deflt; } }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
private boolean verify(Attributes attributes, String entry, byte[] data, int start, int end, boolean ignoreSecondEndline, boolean ignorable) { for (int i = 0; i < DIGEST_ALGORITHMS.length; i++) { String algorithm = DIGEST_ALGORITHMS[i]; String hash = attributes.getValue(algorithm + entry); if (hash == null) { continue; } MessageDigest md; try { md = MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { continue; } if (ignoreSecondEndline && data[end - 1] == '\n' && data[end - 2] == '\n') { md.update(data, start, end - 1 - start); } else { md.update(data, start, end - start); } byte[] b = md.digest(); byte[] hashBytes = hash.getBytes(StandardCharsets.ISO_8859_1); return MessageDigest.isEqual(b, Base64.decode(hashBytes)); } return ignorable; }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
buff = Base64.decode(buff, index); if (buff == null) { throw new IOException("Incorrect Base64 encoding");
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
public static byte[] decode(byte[] in) { return decode(in, in.length); }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
public static byte[] decode(byte[] in) { return decode(in, in.length); }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
public static byte[] decode(byte[] in) { return decode(in, in.length); }
public void addData(String tag, byte[] data, int flags) { System.out.println(tag + ": " + Base64.encode(data)); }
public static byte[] decode(byte[] in) { return decode(in, in.length); }
@Override public void putByteArray(String key, byte[] value) { put(key, Base64.encode(value)); }
public static byte[] decode(byte[] in) { return decode(in, in.length); }
@Override public void putByteArray(String key, byte[] value) { put(key, Base64.encode(value)); }