Example usage for org.bouncycastle.bcpg SignatureSubpacketTags KEY_SERVER_PREFS

List of usage examples for org.bouncycastle.bcpg SignatureSubpacketTags KEY_SERVER_PREFS

Introduction

In this page you can find the example usage for org.bouncycastle.bcpg SignatureSubpacketTags KEY_SERVER_PREFS.

Prototype

int KEY_SERVER_PREFS

To view the source code for org.bouncycastle.bcpg SignatureSubpacketTags KEY_SERVER_PREFS.

Click Source Link

Usage

From source file:org.sufficientlysecure.keychain.support.KeyringBuilder.java

License:Open Source License

/**
 * There is no Preferences subpacket in BouncyCastle, so we have
 * to create one manually.//from  w w  w. ja va2 s.  c om
 */
private static SignatureSubpacket createPreferencesSignatureSubpacket() {
    SignatureSubpacket prefs;
    try {
        prefs = new SignatureSubpacketInputStream(new ByteArrayInputStream(
                new byte[] { 2, SignatureSubpacketTags.KEY_SERVER_PREFS, (byte) 0x80 })).readPacket();
    } catch (IOException ex) {
        throw new RuntimeException(ex);
    }
    return prefs;
}