/** * Create a new key generating the material for it. * The given key must not already exist. * <p/> * This implementation generates the key material and calls the * {@link #createKey(String, byte[], Options)} method. * * @param name the base name of the key * @param options the options for the new key. * @return the version name of the first version of the key. * @throws IOException * @throws NoSuchAlgorithmException */ public KeyVersion createKey(String name, Options options) throws NoSuchAlgorithmException, IOException { byte[] material = generateKey(options.getBitLength(), options.getCipher()); return createKey(name, material, options); }
/** * Roll a new version of the given key generating the material for it. * <p/> * This implementation generates the key material and calls the * {@link #rollNewVersion(String, byte[])} method. * * @param name the basename of the key * @return the name of the new version of the key * @throws IOException */ public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { Metadata meta = getMetadata(name); if (meta == null) { throw new IOException("Can't find Metadata for key " + name); } byte[] material = generateKey(meta.getBitLength(), meta.getCipher()); return rollNewVersion(name, material); }
@Override protected byte[] generateKey(int size, String algorithm) throws NoSuchAlgorithmException { this.size = size; this.algorithm = algorithm; return super.generateKey(size, algorithm); } }
@Override protected byte[] generateKey(int size, String algorithm) throws NoSuchAlgorithmException { this.size = size; this.algorithm = algorithm; return super.generateKey(size, algorithm); } }
/** * Create a new key generating the material for it. * The given key must not already exist. * <p/> * This implementation generates the key material and calls the * {@link #createKey(String, byte[], Options)} method. * * @param name the base name of the key * @param options the options for the new key. * @return the version name of the first version of the key. * @throws IOException * @throws NoSuchAlgorithmException */ public KeyVersion createKey(String name, Options options) throws NoSuchAlgorithmException, IOException { byte[] material = generateKey(options.getBitLength(), options.getCipher()); return createKey(name, material, options); }
/** * Create a new key generating the material for it. * The given key must not already exist. * <p/> * This implementation generates the key material and calls the * {@link #createKey(String, byte[], Options)} method. * * @param name the base name of the key * @param options the options for the new key. * @return the version name of the first version of the key. * @throws IOException * @throws NoSuchAlgorithmException */ public KeyVersion createKey(String name, Options options) throws NoSuchAlgorithmException, IOException { byte[] material = generateKey(options.getBitLength(), options.getCipher()); return createKey(name, material, options); }
/** * Create a new key generating the material for it. * The given key must not already exist. * <p/> * This implementation generates the key material and calls the * {@link #createKey(String, byte[], Options)} method. * * @param name the base name of the key * @param options the options for the new key. * @return the version name of the first version of the key. * @throws IOException * @throws NoSuchAlgorithmException */ public KeyVersion createKey(String name, Options options) throws NoSuchAlgorithmException, IOException { byte[] material = generateKey(options.getBitLength(), options.getCipher()); return createKey(name, material, options); }
/** * Create a new key generating the material for it. * The given key must not already exist. * <p/> * This implementation generates the key material and calls the * {@link #createKey(String, byte[], Options)} method. * * @param name the base name of the key * @param options the options for the new key. * @return the version name of the first version of the key. * @throws IOException * @throws NoSuchAlgorithmException */ public KeyVersion createKey(String name, Options options) throws NoSuchAlgorithmException, IOException { byte[] material = generateKey(options.getBitLength(), options.getCipher()); return createKey(name, material, options); }
/** * Roll a new version of the given key generating the material for it. * <p/> * This implementation generates the key material and calls the * {@link #rollNewVersion(String, byte[])} method. * * @param name the basename of the key * @return the name of the new version of the key * @throws IOException */ public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { Metadata meta = getMetadata(name); byte[] material = generateKey(meta.getBitLength(), meta.getCipher()); return rollNewVersion(name, material); }
/** * Roll a new version of the given key generating the material for it. * <p/> * This implementation generates the key material and calls the * {@link #rollNewVersion(String, byte[])} method. * * @param name the basename of the key * @return the name of the new version of the key * @throws IOException */ public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { Metadata meta = getMetadata(name); byte[] material = generateKey(meta.getBitLength(), meta.getCipher()); return rollNewVersion(name, material); }
/** * Roll a new version of the given key generating the material for it. * <p/> * This implementation generates the key material and calls the * {@link #rollNewVersion(String, byte[])} method. * * @param name the basename of the key * @return the name of the new version of the key * @throws IOException */ public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { Metadata meta = getMetadata(name); byte[] material = generateKey(meta.getBitLength(), meta.getCipher()); return rollNewVersion(name, material); }
/** * Roll a new version of the given key generating the material for it. * <p/> * This implementation generates the key material and calls the * {@link #rollNewVersion(String, byte[])} method. * * @param name the basename of the key * @return the name of the new version of the key * @throws IOException */ public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { Metadata meta = getMetadata(name); byte[] material = generateKey(meta.getBitLength(), meta.getCipher()); return rollNewVersion(name, material); }