Exemple #1
0
 @Override
 public byte[] getStaticData(UserPublicKey owner) {
   byte[] dummy = null;
   StaticData staticData = new StaticData(owner.getPublicKeys(), dummy);
   RowData[] users = staticData.select();
   if (users == null || users.length != 1) return null;
   return users[0].data;
 }
Exemple #2
0
 @Override
 public boolean setStaticData(UserPublicKey owner, byte[] signedStaticData) {
   try {
     StaticData userData =
         new StaticData(owner.getPublicKeys(), owner.unsignMessage(signedStaticData));
     return userData.insert();
   } catch (TweetNaCl.InvalidSignatureException e) {
     System.err.println("Invalid signature setting static data for: " + owner);
     return false;
   }
 }