Class SignatureVerifier

    • Field Detail

      • VERIFY_SIGNATURES_PROPERTY_NAME

        public static final java.lang.String VERIFY_SIGNATURES_PROPERTY_NAME
        Property for whether or not to verify signatures.
        See Also:
        Constant Field Values
      • DEFAULT_VERIFY_SIGNATURE

        public static final java.lang.String DEFAULT_VERIFY_SIGNATURE
        Don't verify signatures (Default).
        See Also:
        Constant Field Values
      • TEST_VERIFY_SIGNATURE

        public static final java.lang.String TEST_VERIFY_SIGNATURE
        Test signatures, but don't reject invalid.
        See Also:
        Constant Field Values
      • ONLY_VERIFY_KNOWN

        public static final java.lang.String ONLY_VERIFY_KNOWN
        Allow products that do not have a configured key.
        See Also:
        Constant Field Values
      • KEYCHAIN_PROPERTY_NAME

        public static final java.lang.String KEYCHAIN_PROPERTY_NAME
        Property for a list of keys.
        See Also:
        Constant Field Values
      • KEYCHAIN_FILE_PROPERTY_NAME

        public static final java.lang.String KEYCHAIN_FILE_PROPERTY_NAME
        Property for a file of keys.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SignatureVerifier

        public SignatureVerifier()
    • Method Detail

      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Description copied from class: DefaultConfigurable
        Process configuration settings. Called before startup().
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class DefaultConfigurable
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • isRejectInvalidSignatures

        public boolean isRejectInvalidSignatures()
        Returns:
        boolean RejectInvalidSignatures
      • setRejectInvalidSignatures

        public void setRejectInvalidSignatures​(boolean rejectInvalidSignatures)
        Parameters:
        rejectInvalidSignatures - boolean to set
      • isTestSignatures

        public boolean isTestSignatures()
        Returns:
        boolean TestSignatures
      • setTestSignatures

        public void setTestSignatures​(boolean testSignatures)
        Parameters:
        testSignatures - boolean to set
      • getKeychain

        public ProductKeyChain getKeychain()
        Returns:
        Product keychain
      • setKeychain

        public void setKeychain​(ProductKeyChain keychain)
        Parameters:
        keychain - ProductKeyChain to set
      • isAllowUnknownSigner

        public boolean isAllowUnknownSigner()
        Returns:
        boolean AllowUnknownSigner
      • setAllowUnknownSigner

        public void setAllowUnknownSigner​(boolean allowUnknownSigner)
        Parameters:
        allowUnknownSigner - boolean to set
      • verifySignature

        public boolean verifySignature​(Product product)
                                throws java.lang.Exception
        Attempt to verify a products signature.
        Parameters:
        product - product to verify.
        Returns:
        true if the signature is from a key in the keychain.
        Throws:
        InvalidSignatureException - if rejectInvalidSignatures=true, and signature was not verified; allowUnknownSigner=true prevents this exception when no keys are found in the keychain for the product.
        java.lang.Exception - if error occurs