Class OnePassSignatureCheck


  • public class OnePassSignatureCheck
    extends java.lang.Object
    Tuple-class that bundles together a PGPOnePassSignature object, a PGPPublicKeyRing destined to verify the signature, the PGPSignature itself and a record of whether the signature was verified.
    • Constructor Summary

      Constructors 
      Constructor Description
      OnePassSignatureCheck​(org.bouncycastle.openpgp.PGPOnePassSignature onePassSignature, org.bouncycastle.openpgp.PGPPublicKeyRing verificationKeys)
      Create a new OnePassSignatureCheck.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.openpgp.PGPOnePassSignature getOnePassSignature()
      Return the PGPOnePassSignature object.
      org.bouncycastle.openpgp.PGPSignature getSignature()
      Return the signature.
      SubkeyIdentifier getSigningKey()
      Return the OpenPgpV4Fingerprint of the signing key.
      org.bouncycastle.openpgp.PGPPublicKeyRing getVerificationKeys()
      Return the key ring used to verify the signature.
      boolean isVerified()
      Return true if the signature is verified.
      void setSignature​(org.bouncycastle.openpgp.PGPSignature signature)  
      boolean verify()
      Verify the one-pass signature.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OnePassSignatureCheck

        public OnePassSignatureCheck​(org.bouncycastle.openpgp.PGPOnePassSignature onePassSignature,
                                     org.bouncycastle.openpgp.PGPPublicKeyRing verificationKeys)
        Create a new OnePassSignatureCheck.
        Parameters:
        onePassSignature - one-pass signature packet used to initialize the signature verifier.
        verificationKeys - verification keys
    • Method Detail

      • setSignature

        public void setSignature​(org.bouncycastle.openpgp.PGPSignature signature)
      • isVerified

        public boolean isVerified()
        Return true if the signature is verified.
        Returns:
        verified
      • getOnePassSignature

        public org.bouncycastle.openpgp.PGPOnePassSignature getOnePassSignature()
        Return the PGPOnePassSignature object.
        Returns:
        onePassSignature
      • verify

        public boolean verify()
                       throws org.bouncycastle.openpgp.PGPException
        Verify the one-pass signature. Note: This method only checks if the signature itself is correct. It does not check if the signing key was eligible to create the signature, or if the signature is expired etc. Those checks are being done by SignatureInputStream.VerifySignatures.
        Returns:
        true if the signature was verified, false otherwise
        Throws:
        org.bouncycastle.openpgp.PGPException - if signature verification fails with an exception.
      • getSignature

        public org.bouncycastle.openpgp.PGPSignature getSignature()
        Return the signature.
        Returns:
        signature
      • getVerificationKeys

        public org.bouncycastle.openpgp.PGPPublicKeyRing getVerificationKeys()
        Return the key ring used to verify the signature.
        Returns:
        verification keys