Code example for NoSuchAlgorithmException

Methods: getMessage

            String digsestFunction = "SHA-256";
            MessageDigest dgst = MessageDigest.getInstance(digsestFunction);
            byte[] byteValue = dgst.digest(value.getBytes());
            return Base64.encode(byteValue);
        } catch (NoSuchAlgorithmException e) {
            log.error(e.getMessage(), e);
            throw new UserStoreException(e.getMessage(), e);
     * Set claim to user store manager 
     * @param userName user name 
     * @param tenantId  tenant id 
     * @param claim  claim uri 
     * @param value  claim value 
     * @throws IdentityException if fails 
    public static void setClaimInUserStoreManager(String userName,int tenantId, String claim,
Experience pair programming with AI  Get Codota for Java