Class PushCertificate


  • public class PushCertificate
    extends java.lang.Object
    The required information to verify the push.

    A valid certificate will not return null from any getter methods; callers may assume that any null value indicates a missing or invalid certificate.

    Since:
    4.0
    • Field Detail

      • version

        private final java.lang.String version
      • pushee

        private final java.lang.String pushee
      • nonce

        private final java.lang.String nonce
      • signature

        private final java.lang.String signature
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
        Get the certificate version string.
        Returns:
        the certificate version string.
        Since:
        4.1
      • getPusher

        public java.lang.String getPusher()
        Get the raw line that signed the cert, as a string.
        Returns:
        the raw line that signed the cert, as a string.
        Since:
        4.0
      • getPusherIdent

        public PushCertificateIdent getPusherIdent()
        Get identity of the pusher who signed the cert.
        Returns:
        identity of the pusher who signed the cert.
        Since:
        4.1
      • getPushee

        public java.lang.String getPushee()
        Get URL of the repository the push was originally sent to.
        Returns:
        URL of the repository the push was originally sent to.
        Since:
        4.0
      • getNonce

        public java.lang.String getNonce()
        Get the raw nonce value that was presented by the pusher.
        Returns:
        the raw nonce value that was presented by the pusher.
        Since:
        4.1
      • getNonceStatus

        public PushCertificate.NonceStatus getNonceStatus()
        Get verification status of the nonce embedded in the certificate.
        Returns:
        verification status of the nonce embedded in the certificate.
        Since:
        4.0
      • getCommands

        public java.util.List<ReceiveCommand> getCommands()
        Get the list of commands as one string to be feed into the signature verifier.
        Returns:
        the list of commands as one string to be feed into the signature verifier.
        Since:
        4.1
      • getSignature

        public java.lang.String getSignature()
        Get the raw signature
        Returns:
        the raw signature, consisting of the lines received between the lines "----BEGIN GPG SIGNATURE-----\n" and "----END GPG SIGNATURE-----\n", inclusive.
        Since:
        4.0
      • toText

        public java.lang.String toText()
        Get text payload of the certificate for the signature verifier.
        Returns:
        text payload of the certificate for the signature verifier.
        Since:
        4.1
      • toTextWithSignature

        public java.lang.String toTextWithSignature()
        Get original text payload plus signature
        Returns:
        original text payload plus signature; the final output will be valid as input to PushCertificateParser.fromString(String).
        Since:
        4.1
      • toStringBuilder

        private java.lang.StringBuilder toStringBuilder()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object