Class ProductKey

  • All Implemented Interfaces:
    Configurable

    public class ProductKey
    extends DefaultConfigurable
    This represents a public key used to verify product signatures. A key should have at least one source and/or one type.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProductKey()
      Empty constructor for the Configurable interface.
      ProductKey​(java.security.PublicKey key, java.util.List<java.lang.String> sources, java.util.List<java.lang.String> types)
      Construct a new ProductPublicKey.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(Config config)
      Process configuration settings.
      java.security.PublicKey getKey()  
      java.util.List<java.lang.String> getSources()  
      java.util.List<java.lang.String> getTypes()  
      boolean isForProduct​(ProductId id)
      Check whether this key is a candidate for verifying a signature.
      void setKey​(java.security.PublicKey key)  
      void shutdown()
      Stop any processing/background threads.
      void startup()
      Start any processing/background threads.
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        public final java.util.logging.Logger LOGGER
        Logger for use in file
      • SOURCES_PROPERTY_NAME

        public final java.lang.String SOURCES_PROPERTY_NAME
        Property name for sources.
        See Also:
        Constant Field Values
      • TYPES_PROPERTY_NAME

        public final java.lang.String TYPES_PROPERTY_NAME
        Property name for types.
        See Also:
        Constant Field Values
      • KEY_PROPERTY_NAME

        public final java.lang.String KEY_PROPERTY_NAME
        Property name for key.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductKey

        public ProductKey()
        Empty constructor for the Configurable interface.
      • ProductKey

        public ProductKey​(java.security.PublicKey key,
                          java.util.List<java.lang.String> sources,
                          java.util.List<java.lang.String> types)
        Construct a new ProductPublicKey. Sources
        Parameters:
        key - the public key.
        sources - the sources to use with this key.
        types - the types to use with this key.
    • Method Detail

      • isForProduct

        public boolean isForProduct​(ProductId id)
        Check whether this key is a candidate for verifying a signature. If any sources, product source must be in list. If any types, product type must be in list.
        Parameters:
        id - which product to check.
        Returns:
        true if this key might verify the signature for given product.
      • 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.
      • getKey

        public java.security.PublicKey getKey()
        Returns:
        the key
      • setKey

        public void setKey​(java.security.PublicKey key)
        Parameters:
        key - the key to set
      • getSources

        public java.util.List<java.lang.String> getSources()
        Returns:
        the sources
      • getTypes

        public java.util.List<java.lang.String> getTypes()
        Returns:
        the types