Example usage for org.bouncycastle.bcpg.sig KeyFlags getFlags

List of usage examples for org.bouncycastle.bcpg.sig KeyFlags getFlags

Introduction

In this page you can find the example usage for org.bouncycastle.bcpg.sig KeyFlags getFlags.

Prototype

public int getFlags() 

Source Link

Document

Return the flag values contained in the first 4 octets (note: at the moment the standard only uses the first one).

Usage

From source file:com.google.e2e.bcdriver.Util.java

License:Apache License

static final boolean hasKeyFlag(PGPSignature sig, int flag) {
    PGPSignatureSubpacketVector hashed = sig.getHashedSubPackets();
    if (hashed == null) {
        return false;
    }//from  w  w  w.  j a v  a  2s  . c om

    KeyFlags flags = (KeyFlags) hashed.getSubpacket(SignatureSubpacketTags.KEY_FLAGS);
    if (flags == null) {
        return false;
    }
    return ((flags.getFlags() & flag) != 0);
}