Example usage for org.bouncycastle.bcpg PublicKeyPacket getEncoded

List of usage examples for org.bouncycastle.bcpg PublicKeyPacket getEncoded

Introduction

In this page you can find the example usage for org.bouncycastle.bcpg PublicKeyPacket getEncoded.

Prototype

public byte[] getEncoded() throws IOException 

Source Link

Usage

From source file:google.registry.keyring.api.ComparatorKeyring.java

License:Open Source License

@VisibleForTesting
static boolean compare(PublicKeyPacket a, PublicKeyPacket b) {
    if (a == null || b == null) {
        return a == null && b == null;
    }/*from w  w w .  j  av  a2s  . c  om*/
    try {
        return Arrays.equals(a.getEncoded(), b.getEncoded());
    } catch (IOException e) {
        logger.severefmt("ComparatorKeyring error: PublicKeyPacket.getEncoded failed: %s", e);
        return false;
    }
}