Example usage for org.bouncycastle.bcpg.sig RevocationReason RevocationReason

List of usage examples for org.bouncycastle.bcpg.sig RevocationReason RevocationReason

Introduction

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

Prototype

public RevocationReason(boolean isCritical, byte reason, String description) 

Source Link

Usage

From source file:org.sufficientlysecure.keychain.pgp.WrappedSignature.java

License:Open Source License

public String getRevocationReason() throws PgpGeneralException {
    if (!isRevocation()) {
        throw new PgpGeneralException("Not a revocation signature.");
    }// w w w .  ja v  a2  s  .co  m
    if (mSig.getHashedSubPackets() == null) {
        return null;
    }
    SignatureSubpacket p = mSig.getHashedSubPackets().getSubpacket(SignatureSubpacketTags.REVOCATION_REASON);
    // For some reason, this is missing in SignatureSubpacketInputStream:146
    if (!(p instanceof RevocationReason)) {
        p = new RevocationReason(false, false, p.getData());
    }
    return ((RevocationReason) p).getRevocationDescription();
}