Code example for PrivateKey

Methods: getAlgorithm

0
     */ 
    public PrivateKeySignature(PrivateKey pk, String hashAlgorithm, String provider) {
        this.pk = pk;
        this.provider = provider;
        this.hashAlgorithm = DigestAlgorithms.getDigest(DigestAlgorithms.getAllowedDigests(hashAlgorithm));
        encryptionAlgorithm = pk.getAlgorithm();
        if (encryptionAlgorithm.startsWith("EC")) {
        	encryptionAlgorithm = "ECDSA";
        } 
    } 
 
    /** 
     * Returns the hash algorithm. 
     * @return	the hash algorithm (e.g. "SHA-1", "SHA-256,...") 
     * @see com.itextpdf.text.pdf.security.ExternalSignature#getHashAlgorithm() 
     */ 
    public String getHashAlgorithm() {
        return hashAlgorithm;
    } 
 
    /**