@Override Object decode(Decoder dec, String s) throws Exception { return Hex.toByteArray(s); } }
@Override public Object convert(Type dest, Object o) throws Exception { if (o instanceof String) return Hex.toByteArray((String) o); return null; } });
@Override public Object convert(Type dest, Object o) throws Exception { if (o instanceof String) { String s = (String) o; if (Hex.isHex(s)) return Hex.toByteArray(s); } return null; } });
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
return Hex.toByteArray(sb.toString()); else return Base64.decodeBase64(sb.toString());
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error( "The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error( "The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
if (digest != null) { if (Hex.isHex(digest.trim())) { byte[] sha1 = Hex.toByteArray(digest); byte[] filesha1 = SHA1.digest(f).digest(); if (!Arrays.equals(sha1, filesha1)) {
if (digest != null) { if (Hex.isHex(digest.trim())) { byte[] sha1 = Hex.toByteArray(digest); byte[] filesha1 = SHA1.digest(f).digest(); if (!Arrays.equals(sha1, filesha1)) {
@Override public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Workspace ws = registry.getPlugin(Workspace.class); Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error("The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
@Override public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Workspace ws = registry.getPlugin(Workspace.class); Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error("The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
if (digest != null) { if (Hex.isHex(digest.trim())) { byte[] sha1 = Hex.toByteArray(digest); byte[] filesha1 = SHA1.digest(f) .digest();