Exemplo n.º 1
0
 MetadataBlob(String b64WritingKey, String b64mapkey, String b64blobdata) {
   this(
       Base64.getDecoder().decode(b64WritingKey),
       b64WritingKey,
       Base64.getDecoder().decode(b64mapkey),
       b64mapkey,
       Base64.getDecoder().decode(b64blobdata),
       b64blobdata);
 }
Exemplo n.º 2
0
 MetadataBlob(byte[] writingKey, byte[] mapkey, byte[] blobdata) {
   this(
       writingKey,
       new String(Base64.getEncoder().encode(writingKey)),
       mapkey,
       new String(Base64.getEncoder().encode(mapkey)),
       blobdata,
       blobdata == null ? null : new String(Base64.getEncoder().encode(blobdata)));
 }
Exemplo n.º 3
0
 @Override
 public String getUsername(byte[] encodedKey) {
   String b64key = Base64.getEncoder().encodeToString(encodedKey);
   try {
     try (PreparedStatement preparedStatement =
         conn.prepareStatement("select name from users where publickey = ? limit 1")) {
       preparedStatement.setString(1, b64key);
       ResultSet resultSet = preparedStatement.executeQuery();
       boolean next = resultSet.next();
       if (!next) return "";
       return resultSet.getString(1);
     }
   } catch (SQLException sqle) {
     throw new IllegalStateException(sqle);
   }
 }
Exemplo n.º 4
0
 RowData(String name, String d) {
   this(name, Base64.getDecoder().decode(d), d);
 }
Exemplo n.º 5
0
 RowData(String name, byte[] data) {
   this(name, data, (data == null ? null : new String(Base64.getEncoder().encode(data))));
 }
Exemplo n.º 6
0
 StaticData(byte[] publicKey, byte[] staticdata) {
   super(new String(Base64.getEncoder().encode(publicKey)), staticdata);
 }