示例#1
0
 @Override
 public byte[] encode(byte[] toEncode, byte[] salt, byte[] passphrase, String charset)
     throws EncoderException {
   for (Encoder encoder : encoders) {
     toEncode = encoder.encode(toEncode, salt, passphrase, charset);
   }
   return toEncode;
 }
示例#2
0
 @Override
 public boolean isOfType(byte[] encodedBytes, String charset) {
   for (Encoder encoder : encoders) {
     if (!encoder.isOfType(encodedBytes, charset)) {
       return false;
     }
   }
   return true;
 }
示例#3
0
 @Override
 public byte[] decode(byte[] toDecode, byte[] passphrase, String charset) throws EncoderException {
   List<Encoder> reverse = new ArrayList<Encoder>(encoders);
   Collections.reverse(reverse);
   for (Encoder encoder : reverse) {
     toDecode = encoder.decode(toDecode, passphrase, charset);
   }
   return toDecode;
 }