public class PublicKeyFilePropertyType extends AbstractKeyPropertyType<PublicKey> implements MarkerPathPropertyType
Property<File> FILE_PROPERTY = new Property<File>("publickey.file.property", new FilePropertyType(new File("c:\temp\mypublickey.pub"));
Property<PublicKey> A_PROPERTY= new Property<PublicKey>("name", new PublicKeyFilePropertyType(FILE_PROPERTY,"DSA"));
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The type name string constant of PublicKey PropertyType.
|
PKCS8_ENCODED_KEY_SPEC, X509_ENCODED_KEY_SPEC| Constructor and Description |
|---|
PublicKeyFilePropertyType(Property<File> derivedFromFile,
KeyFactoryAlgorithms algorithm)
Constructor using the "X509EncodedKeySpec" for encodedKeySpecClass.
|
PublicKeyFilePropertyType(Property<File> derivedFromFile,
KeyFactoryAlgorithms algorithm,
Class<? extends EncodedKeySpec> encodedKeySpecClass)
Constructor.
|
PublicKeyFilePropertyType(Property<File> derivedFromFile,
String algorithm)
Constructor using the "X509EncodedKeySpec" for encodedKeySpecClass.
|
PublicKeyFilePropertyType(Property<File> derivedFromFile,
String algorithm,
Class<? extends EncodedKeySpec> encodedKeySpecClass)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getDerivedToRestrictions()
Gets a detailed description of the "Derived->TO->PropertyType" with any constraints that might influence the validation.
Without any futher description of of the properties it is derived from, this is taken care of in the method "getDerivedFromRestrictions". |
protected PublicKey |
validateKey(EncodedKeySpec spec)
Gets the PublicKey from KeyFactory.
|
getAlgorithm, getEncodedKeySpecClass, getEncodedKeySpecInstance, getKeyFactory, validateConstraints, validateDerivedValuegetDerivedFromProperty, getDerivedFromPropertyValuegetDerivedFrom, getDerivedFromCount, getDerivedFromProperty, getDerivedFromRestrictions, getMaxDerivedFrom, getMinDerivedFrom, getRestrictions, isMinAndMaxTheSame, isUseMaxDerivedFrom, isUseMinDerivedFrom, validateValueequals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateNullTypepublic static final String TYPE
public PublicKeyFilePropertyType(Property<File> derivedFromFile, String algorithm, Class<? extends EncodedKeySpec> encodedKeySpecClass)
derivedFromFile - the property which returns the file where the PublicKey is stored.algorithm - the name of the algortihm used.encodedKeySpecClass - the class used to encoded the bytes.EncodedKeySpec,
X509EncodedKeySpec,
PKCS8EncodedKeySpec,
KeyFactory,
KeyFactoryAlgorithmspublic PublicKeyFilePropertyType(Property<File> derivedFromFile, KeyFactoryAlgorithms algorithm, Class<? extends EncodedKeySpec> encodedKeySpecClass)
derivedFromFile - the property which returns the file where the PublicKey is stored.algorithm - the name of the algortihm used.encodedKeySpecClass - the class used to encoded the bytes.EncodedKeySpec,
X509EncodedKeySpec,
PKCS8EncodedKeySpec,
KeyFactory,
KeyFactoryAlgorithmspublic PublicKeyFilePropertyType(Property<File> derivedFromFile, String algorithm)
derivedFromFile - the property which returns the file where the PublicKey is stored.algorithm - the name of the algortihm used.X509EncodedKeySpecpublic PublicKeyFilePropertyType(Property<File> derivedFromFile, KeyFactoryAlgorithms algorithm)
derivedFromFile - the property which returns the file where the PublicKey is stored.algorithm - the name of the algortihm used.X509EncodedKeySpecpublic List<String> getDerivedToRestrictions()
DerivedPropertyTypegetDerivedToRestrictions in class DerivedPropertyType<PublicKey>protected PublicKey validateKey(EncodedKeySpec spec) throws PropertyException
return getKeyFactory().generatePublic(spec);
validateKey in class AbstractKeyPropertyType<PublicKey>spec - an instance of EncodedKeySpec, which can be used with the KeyFactory to generate a Key.PropertyException - the key could not be converted and/or validated to type T of key.