/** * Method engineGetJCEAlgorithmString * * {@inheritDoc} */ protected String engineGetJCEProviderName() { return this.macAlgorithm.getProvider().getName(); }
public String getProvider() { if(mac==null) { return null; } return mac.getProvider().getName(); }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @param provider * the provider * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if a MacSpi implementation for the specified algorithm is not * available from the specified provider. */ public static Hkdf getInstance(final String algorithm, final Provider provider) throws NoSuchAlgorithmException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm, provider); return new Hkdf(algorithm, mac.getProvider()); }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if no Provider supports a MacSpi implementation for the * specified algorithm. */ public static Hkdf getInstance(final String algorithm) throws NoSuchAlgorithmException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm); return new Hkdf(algorithm, mac.getProvider()); }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if no Provider supports a MacSpi implementation for the * specified algorithm. */ public static Hkdf getInstance(final String algorithm) throws NoSuchAlgorithmException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm); return new Hkdf(algorithm, mac.getProvider()); }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @param provider * the name of the provider * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if a MacSpi implementation for the specified algorithm is not * available from the specified provider. * @throws NoSuchProviderException * if the specified provider is not registered in the security * provider list. */ public static Hkdf getInstance(final String algorithm, final String provider) throws NoSuchAlgorithmException, NoSuchProviderException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm, provider); return new Hkdf(algorithm, mac.getProvider()); }
/** * Get a Mac with the wrapped characteristics * * @return A Mac * @throws NoSuchAlgorithmException * If the algorithm name is incorrect */ public Mac getMac() throws NoSuchAlgorithmException { String name= getHmacName(); Provider provider= providers.getProvider(name); Mac mac; if (provider == null) { mac= Mac.getInstance(name); } else { mac= Mac.getInstance(name, provider); } LOGGER.debug(FOUND_CL_ALG_PROV, mac.getClass().getSimpleName(), name, mac.getProvider().getName()); return mac; }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @param provider * the name of the provider * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if a MacSpi implementation for the specified algorithm is not * available from the specified provider. * @throws NoSuchProviderException * if the specified provider is not registered in the security * provider list. */ public static Hkdf getInstance(final String algorithm, final String provider) throws NoSuchAlgorithmException, NoSuchProviderException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm, provider); return new Hkdf(algorithm, mac.getProvider()); }
/** * Returns an <code>Hkdf</code> object using the specified algorithm. * * @param algorithm * the standard name of the requested MAC algorithm. See the Mac * section in the <a href= * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac" * > Java Cryptography Architecture Standard Algorithm Name * Documentation</a> for information about standard algorithm * names. * @param provider * the provider * @return the new <code>Hkdf</code> object * @throws NoSuchAlgorithmException * if a MacSpi implementation for the specified algorithm is not * available from the specified provider. */ public static Hkdf getInstance(final String algorithm, final Provider provider) throws NoSuchAlgorithmException { // Constructed specifically to sanity-test arguments. Mac mac = Mac.getInstance(algorithm, provider); return new Hkdf(algorithm, mac.getProvider()); }
/** * Get a Mac with the wrapped characteristics and the given key * * @param key * The key used to generate the Mac * @return The mac * @throws NoSuchAlgorithmException * If the algorithm name is incorrect * @throws InvalidKeyException * If the key is incorrect */ public Mac getMac(Key key) throws InvalidKeyException, NoSuchAlgorithmException { final Mac mac= getMac(); mac.init(key); LOGGER.debug("Instantiated algorithm {} with provider {}", hmacName, mac.getProvider().getInfo()); return mac; }