Package gov.usgs.earthquake.distribution
Class ProductKeyChain
java.lang.Object
gov.usgs.earthquake.distribution.ProductKeyChain
A group of keys that can be used to verify product signatures.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructorProductKeyChain
(String keys, Config config) Constructor for a string of keysProductKeyChain
(List<String> keys, Config config) Constructor for list of keys -
Method Summary
Modifier and TypeMethodDescriptionstatic ProductKeyChain
Static constructor to create from a fileprotected static ProductKeyChain
fromIniFile
(File keychainFile, String propertyStart) Static constructor create from an ini fileprotected static ProductKeyChain
fromYmlFile
(File keychainFile, String propertyStart) Static constructor create from an yml fileFind public keys based on configured Keys.
-
Constructor Details
-
ProductKeyChain
public ProductKeyChain()Empty constructor -
ProductKeyChain
Constructor for a string of keys- Parameters:
keys
- String of keys, separated by commasconfig
- Config file- Throws:
Exception
- if error occurs
-
ProductKeyChain
Constructor for list of keys- Parameters:
keys
- String list of keysconfig
- Config file- Throws:
Exception
- if error occurs
-
-
Method Details
-
fromFile
Static constructor to create from a file- Parameters:
keychainFile
- File to usepropertyStart
- The property to look for the keychain from- Throws:
Exception
- if error occurs
-
fromIniFile
protected static ProductKeyChain fromIniFile(File keychainFile, String propertyStart) throws Exception Static constructor create from an ini file- Parameters:
keychainFile
- File to usepropertyStart
- The property to look for the keychain from- Throws:
IOException
- if the file does not existException
- if error occurs
-
fromYmlFile
protected static ProductKeyChain fromYmlFile(File keychainFile, String propertyStart) throws Exception Static constructor create from an yml file- Parameters:
keychainFile
- File to usepropertyStart
- The property to look for the keychain from- Throws:
IOException
- if the file does not existException
- if error occurs
-
getKeychain
- Returns:
- the keys
-
getProductKeys
Find public keys based on configured Keys.- Parameters:
id
- ID of product- Returns:
- an array of candidate keys used to verify a signature.
-