Example usage for java.security NoSuchAlgorithmException NoSuchAlgorithmException

List of usage examples for java.security NoSuchAlgorithmException NoSuchAlgorithmException

Introduction

In this page you can find the example usage for java.security NoSuchAlgorithmException NoSuchAlgorithmException.

Prototype

public NoSuchAlgorithmException() 

Source Link

Document

Constructs a NoSuchAlgorithmException with no detail message.

Usage

From source file:org.fejoa.library.crypto.UserKeyParameters.java

static private MessageDigest getMessageDigest(String algo) throws NoSuchAlgorithmException {
    switch (algo) {
    case CryptoSettings.SHA2:
        return CryptoHelper.sha256Hash();
    case CryptoSettings.SHA3_256:
        return CryptoHelper.sha3_256Hash();
    default://w ww.  j a va  2 s.c om
        throw new NoSuchAlgorithmException();
    }
}

From source file:org.psikeds.common.idgen.impl.RandomStringGenerator.java

/**
 * @param randomAlgorithm//from  w  w  w.  j  a v  a  2 s. co  m
 *          the randomAlgorithm to set
 */
public void setRandomAlgorithm(final String randomAlgorithm) throws NoSuchAlgorithmException {
    if (StringUtils.isEmpty(randomAlgorithm)) {
        throw new NoSuchAlgorithmException();
    }
    if ((this.secran == null) || !randomAlgorithm.equals(this.randomAlgorithm)) {
        this.secran = SecureRandom.getInstance(randomAlgorithm);
        this.randomAlgorithm = randomAlgorithm;
    }
}