Example usage for org.bouncycastle.openpgp PGPSignature getKeyAlgorithm

List of usage examples for org.bouncycastle.openpgp PGPSignature getKeyAlgorithm

Introduction

In this page you can find the example usage for org.bouncycastle.openpgp PGPSignature getKeyAlgorithm.

Prototype

public int getKeyAlgorithm() 

Source Link

Document

Return the key algorithm associated with this signature.

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  ww  w . j a v  a 2s.  com
    return null;
}