@Test public void testFileKey() throws Exception { final JSON json = new JSON(); final FileKey fileKey = TripleCryptConverter.toSwaggerFileKey(Crypto.generateFileKey()); assertNotNull(fileKey.getIv()); assertNotNull(fileKey.getKey()); assertNull(fileKey.getTag()); assertNotNull(fileKey.getVersion()); final ObjectWriter writer = json.getContext(null).writerFor(FileKey.class); final ByteArrayOutputStream out = new ByteArrayOutputStream(); writer.writeValue(out, fileKey); final ByteBuffer buffer = ByteBuffer.wrap(out.toByteArray()); final ObjectReader reader = json.getContext(null).readerFor(FileKey.class); assertEquals(fileKey, reader.readValue(buffer.array())); }
public static FileKey toSwaggerFileKey(final EncryptedFileKey k) { return new FileKey().key(k.getKey()).iv(k.getIv()).tag(k.getTag()).version(k.getVersion()); }
TripleCryptConverter { public static FileKey toSwaggerFileKey(final EncryptedFileKey k) { return new FileKey().key(k.getKey()).iv(k.getIv()).tag(k.getTag()).version(k.getVersion()); } }
TripleCryptConverter { public static FileKey toSwaggerFileKey(final EncryptedFileKey k) { return new FileKey().key(k.getKey()).iv(k.getIv()).tag(k.getTag()).version(k.getVersion()); }  }
TripleCryptConverter { public static FileKey toSwaggerFileKey(final EncryptedFileKey k) { return new FileKey().key(k.getKey()).iv(k.getIv()).tag(k.getTag()).version(k.getVersion()); }  static FileKey toSwaggerFileKey(final EncryptedFileKey k); static FileKey toSwaggerFileKey(final PlainFileKey k); static UserKeyPairContainer toSwaggerUserKeyPairContainer(final UserKeyPair pair); static UserPublicKey toCryptoUserPublicKey(final PublicKeyContainer c); static PlainFileKey toCryptoPlainFileKey(final FileKey key); static EncryptedFileKey toCryptoEncryptedFileKey(final FileKeyContainer key); static EncryptedFileKey toCryptoEncryptedFileKey(final FileKey k); }
TripleCryptConverter { public static FileKey toSwaggerFileKey(final EncryptedFileKey k) { return new FileKey().key(k.getKey()).iv(k.getIv()).tag(k.getTag()).version(k.getVersion()); }  static FileKey toSwaggerFileKey(final EncryptedFileKey k); static FileKey toSwaggerFileKey(final PlainFileKey k); static UserKeyPairContainer toSwaggerUserKeyPairContainer(final UserKeyPair pair); static UserPublicKey toCryptoUserPublicKey(final PublicKeyContainer c); static PlainFileKey toCryptoPlainFileKey(final FileKey key); static EncryptedFileKey toCryptoEncryptedFileKey(final FileKeyContainer key); static EncryptedFileKey toCryptoEncryptedFileKey(final FileKey k);  }