public static synchronized Signature getSignature(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Signature.getInstance(algorithm); else return Signature.getInstance(algorithm, getSecurityProvider()); }
public static synchronized Cipher getCipher(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Cipher.getInstance(transformation); else return Cipher.getInstance(transformation, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyFactory} with the given algorithm. * * @param algorithm key factory algorithm e.g. RSA, DSA * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyFactory.getInstance(algorithm); else return KeyFactory.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyPairGenerator} with the given algorithm. * * @param algorithm key pair generator algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyPairGenerator getKeyPairGenerator(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyPairGenerator.getInstance(algorithm); else return KeyPairGenerator.getInstance(algorithm, getSecurityProvider()); }
/** * Create a new instance of {@link Mac} with the given algorithm. * * @param algorithm MAC algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized Mac getMAC(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Mac.getInstance(algorithm); else return Mac.getInstance(algorithm, getSecurityProvider()); }
/** * Create a new instance of {@link MessageDigest} with the given algorithm. * * @param algorithm MessageDigest algorithm name * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return MessageDigest.getInstance(algorithm); else return MessageDigest.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyAgreement} with the given algorithm. * * @param algorithm key agreement algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyAgreement getKeyAgreement(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyAgreement.getInstance(algorithm); else return KeyAgreement.getInstance(algorithm, getSecurityProvider()); }
pemConverter.setProvider(SecurityUtils.getSecurityProvider()); decryptorBuilder.setProvider(SecurityUtils.getSecurityProvider()); try { passphrase = pwdf == null ? null : pwdf.reqPassword(resource);
public static synchronized Signature getSignature(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Signature.getInstance(algorithm); else return Signature.getInstance(algorithm, getSecurityProvider()); }
public static synchronized Cipher getCipher(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Cipher.getInstance(transformation); else return Cipher.getInstance(transformation, getSecurityProvider()); }
public static synchronized Cipher getCipher(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Cipher.getInstance(transformation); else return Cipher.getInstance(transformation, getSecurityProvider()); }
public static synchronized Signature getSignature(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Signature.getInstance(algorithm); else return Signature.getInstance(algorithm, getSecurityProvider()); }
/** * Create a new instance of {@link MessageDigest} with the given algorithm. * * @param algorithm MessageDigest algorithm name * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return MessageDigest.getInstance(algorithm); else return MessageDigest.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyPairGenerator} with the given algorithm. * * @param algorithm key pair generator algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyPairGenerator getKeyPairGenerator(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyPairGenerator.getInstance(algorithm); else return KeyPairGenerator.getInstance(algorithm, getSecurityProvider()); }
/** * Create a new instance of {@link Mac} with the given algorithm. * * @param algorithm MAC algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized Mac getMAC(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Mac.getInstance(algorithm); else return Mac.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyFactory} with the given algorithm. * * @param algorithm key factory algorithm e.g. RSA, DSA * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyFactory.getInstance(algorithm); else return KeyFactory.getInstance(algorithm, getSecurityProvider()); }
/** * Create a new instance of {@link MessageDigest} with the given algorithm. * * @param algorithm MessageDigest algorithm name * * @return new instance * * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized MessageDigest getMessageDigest(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return MessageDigest.getInstance(algorithm); else return MessageDigest.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyFactory} with the given algorithm. * * @param algorithm key factory algorithm e.g. RSA, DSA * * @return new instance * * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyFactory.getInstance(algorithm); else return KeyFactory.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyAgreement} with the given algorithm. * * @param algorithm key agreement algorithm * @return new instance * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyAgreement getKeyAgreement(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyAgreement.getInstance(algorithm); else return KeyAgreement.getInstance(algorithm, getSecurityProvider()); }
/** * Creates a new instance of {@link KeyAgreement} with the given algorithm. * * @param algorithm key agreement algorithm * * @return new instance * * @throws NoSuchAlgorithmException * @throws NoSuchProviderException */ public static synchronized KeyAgreement getKeyAgreement(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return KeyAgreement.getInstance(algorithm); else return KeyAgreement.getInstance(algorithm, getSecurityProvider()); }