Code example for PrivateKey

Methods: getAlgorithm

0
        if (stringToBeSigned == null)
            throw logger.nullArgumentError("stringToBeSigned");
        if (signingKey == null)
            throw logger.nullArgumentError("signingKey");
 
        String algo = signingKey.getAlgorithm();
        Signature sig = getSignature(algo);
        sig.initSign(signingKey);
        sig.update(stringToBeSigned.getBytes());
        return sig.sign();
    } 
 
    /** 
     * Validate the signed content with the signature value 
     * 
     * @param signedContent 
     * @param signatureValue 
     * @param validatingKey 
     * @return 
     * @throws GeneralSecurityException 
Contextual code suggestions in your IDE  Get Codota for Java