@Test(expectedExceptions = Exception.class) public void writeKeyWithNullKey() throws IOException { SecretKeyUtils.writeKey(null, null); }
public static void writeKey(final SecretKey key, final OutputStream out) throws IOException { Validate.notNull(key, "Key must not be null"); Validate.notNull(out, "OutputStream must not be null"); X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( key.getEncoded()); out.write(x509EncodedKeySpec.getEncoded()); }
SecretKeyUtils { public static void writeKey(final SecretKey key, final OutputStream out) throws IOException { Validate.notNull(key, "Key must not be null"); Validate.notNull(out, "OutputStream must not be null"); X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( key.getEncoded()); out.write(x509EncodedKeySpec.getEncoded()); } }
SecretKeyUtils { public static void writeKey(final SecretKey key, final OutputStream out) throws IOException { Validate.notNull(key, "Key must not be null"); Validate.notNull(out, "OutputStream must not be null"); X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( key.getEncoded()); out.write(x509EncodedKeySpec.getEncoded()); } private  SecretKeyUtils(); }
SecretKeyUtils { public static void writeKey(final SecretKey key, final OutputStream out) throws IOException { Validate.notNull(key, "Key must not be null"); Validate.notNull(out, "OutputStream must not be null"); X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( key.getEncoded()); out.write(x509EncodedKeySpec.getEncoded()); } private  SecretKeyUtils(); static SecretKey generate(final SupportedCipherDetails cipherDetails); static SecretKey generate(final String algorithm, final int bits); static void writeKey(final SecretKey key, final OutputStream out); static void writeKeyToPath(final SecretKey key, final Path path); static SecretKeySpec loadKey(final byte[] bytes, final SupportedCipherDetails cipherDetails); static SecretKeySpec loadKey(final InputStream in, final String algorithm); static SecretKeySpec loadKeyFromPath(final Path path, final String algorithm); static SecretKeySpec loadKeyFromPath(final Path path,
                                                final SupportedCipherDetails cipherDetails); }
SecretKeyUtils { public static void writeKey(final SecretKey key, final OutputStream out) throws IOException { Validate.notNull(key, "Key must not be null"); Validate.notNull(out, "OutputStream must not be null"); X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec( key.getEncoded()); out.write(x509EncodedKeySpec.getEncoded()); } private  SecretKeyUtils(); static SecretKey generate(final SupportedCipherDetails cipherDetails); static SecretKey generate(final String algorithm, final int bits); static void writeKey(final SecretKey key, final OutputStream out); static void writeKeyToPath(final SecretKey key, final Path path); static SecretKeySpec loadKey(final byte[] bytes, final SupportedCipherDetails cipherDetails); static SecretKeySpec loadKey(final InputStream in, final String algorithm); static SecretKeySpec loadKeyFromPath(final Path path, final String algorithm); static SecretKeySpec loadKeyFromPath(final Path path,
                                                final SupportedCipherDetails cipherDetails);  }