Class Decryptor.Verifier

java.lang.Object
org.c02e.jpgpj.Decryptor.Verifier
Enclosing class:
Decryptor

protected class Decryptor.Verifier extends Object
Helper for verifying a given message signature.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    org.bouncycastle.openpgp.PGPSignature
     
    org.bouncycastle.openpgp.PGPOnePassSignature
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Verifier(org.bouncycastle.openpgp.PGPOnePassSignature s)
     
    Verifier(org.bouncycastle.openpgp.PGPSignature s)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Subkey
    Finds verification subkey by ID in this Decryptor's ring, or null.
    Copy of matched key with signingUid configured and only public subkeys, or null.
    long
    Key ID of signing subkey.
    boolean
     
    boolean
    match(org.bouncycastle.openpgp.PGPSignature s)
    Tries to match the specified PGPSignature to this verifier's PGPOnePassSignature (sig1); if found sets sig and returns true.
    void
    setSig(org.bouncycastle.openpgp.PGPSignature s)
     
    void
    setSig1(org.bouncycastle.openpgp.PGPOnePassSignature s)
     
    boolean
    True if the signature checks out.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • key

      public Key key
    • sig

      public org.bouncycastle.openpgp.PGPSignature sig
    • sig1

      public org.bouncycastle.openpgp.PGPOnePassSignature sig1
  • Constructor Details

    • Verifier

      public Verifier()
    • Verifier

      public Verifier(org.bouncycastle.openpgp.PGPSignature s) throws org.bouncycastle.openpgp.PGPException
      Throws:
      org.bouncycastle.openpgp.PGPException
    • Verifier

      public Verifier(org.bouncycastle.openpgp.PGPOnePassSignature s) throws org.bouncycastle.openpgp.PGPException
      Throws:
      org.bouncycastle.openpgp.PGPException
  • Method Details

    • isKeyAvailable

      public boolean isKeyAvailable()
    • setSig

      public void setSig(org.bouncycastle.openpgp.PGPSignature s) throws org.bouncycastle.openpgp.PGPException
      Throws:
      org.bouncycastle.openpgp.PGPException
    • setSig1

      public void setSig1(org.bouncycastle.openpgp.PGPOnePassSignature s) throws org.bouncycastle.openpgp.PGPException
      Throws:
      org.bouncycastle.openpgp.PGPException
    • match

      public boolean match(org.bouncycastle.openpgp.PGPSignature s)
      Tries to match the specified PGPSignature to this verifier's PGPOnePassSignature (sig1); if found sets sig and returns true.
    • verify

      public boolean verify() throws org.bouncycastle.openpgp.PGPException
      True if the signature checks out.
      Throws:
      org.bouncycastle.openpgp.PGPException
    • getSignedBy

      public Key getSignedBy() throws org.bouncycastle.openpgp.PGPException
      Copy of matched key with signingUid configured and only public subkeys, or null.
      Throws:
      org.bouncycastle.openpgp.PGPException
    • getSignedByKeyId

      public long getSignedByKeyId()
      Key ID of signing subkey.
    • findVerificationSubkey

      protected Subkey findVerificationSubkey(Long id)
      Finds verification subkey by ID in this Decryptor's ring, or null. If found, also sets "key" field to subkey's key.