Example usage for org.bouncycastle.openpgp PGPUtil getSignatureName

List of usage examples for org.bouncycastle.openpgp PGPUtil getSignatureName

Introduction

In this page you can find the example usage for org.bouncycastle.openpgp PGPUtil getSignatureName.

Prototype

public static String getSignatureName(int keyAlgorithm, int hashAlgorithm) throws PGPException 

Source Link

Document

Return an appropriate name for the signature algorithm represented by the passed in public key and hash algorithm ID numbers.

Usage

From source file:org.pgptool.gui.encryption.implpgp.KeyFilesOperationsPgpImpl.java

License:Open Source License

@SuppressWarnings("rawtypes")
private static String resolveAlgorithm(PGPPublicKey key) throws PGPException {
    for (Iterator iter = key.getSignatures(); iter.hasNext();) {
        PGPSignature sig = (PGPSignature) iter.next();
        return PGPUtil.getSignatureName(sig.getKeyAlgorithm(), sig.getHashAlgorithm());
    }/*from w w  w .  java2s .  c  o  m*/
    return null;
}