io.vertx.ext.httpservicefactory

## Class PGPHelper

- java.lang.Object
- - io.vertx.ext.httpservicefactory.PGPHelper

-     public class PGPHelper
      extends Object

  Author:
    Julien Viet

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PGPHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.bouncycastle.openpgp.PGPPublicKey` | `getPublicKey(byte[] block, long keyID)` Get a public key from a public key block.
    `static org.bouncycastle.openpgp.PGPSignature` | `getSignature(byte[] signature)` Get a signature from its bytes
    `static boolean` | `verifySignature(InputStream file, InputStream signature, org.bouncycastle.openpgp.PGPPublicKey key)` Verify a PGP signature.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PGPHelper

          public PGPHelper()

  - ### Method Detail

    - #### getSignature

          public static org.bouncycastle.openpgp.PGPSignature getSignature(byte[] signature)
                                                                    throws Exception

      Get a signature from its bytes
      Parameters:
        `signature` - the bytes
      Returns:
        the pgp signature object
      Throws:
        `Exception`

    - #### getPublicKey

          public static org.bouncycastle.openpgp.PGPPublicKey getPublicKey(byte[] block,
                                                                           long keyID)
                                                                    throws Exception

      Get a public key from a public key block.
      Parameters:
        `block` - the public key block
        `keyID` - the key id
      Returns:
        the public key
      Throws:
        `Exception` - anything that would prevent to obtain the key

    - #### verifySignature

          public static boolean verifySignature(InputStream file,
                                                InputStream signature,
                                                org.bouncycastle.openpgp.PGPPublicKey key)
                                         throws Exception

      Verify a PGP signature.
      Parameters:
        `file` - the file
        `signature` - the signature
        `key` - the public key
      Returns:
        true if the signature is verified
      Throws:
        `Exception` - anything preventing the verification to happen

Copyright © 2016. All rights reserved.