public class PrivateKeyFilePropertyType extends AbstractKeyPropertyType<PrivateKey> implements MarkerPathPropertyType
Property<File> FILE_PROPERTY = new Property<File>("privatekey.file.property", new FilePropertyType(new File("c:\temp\myprivatekey.ppk"));
Property<PrivateKey> A_PROPERTY= new Property<PrivateKey>("name", new PrivateKeyFilePropertyType(FILE_PROPERTY,"DSA"));
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The type name string constant of PrivateKey PropertyType.
|
PKCS8_ENCODED_KEY_SPEC, X509_ENCODED_KEY_SPEC| Constructor and Description |
|---|
PrivateKeyFilePropertyType(Property<File> derivedFromFile,
KeyFactoryAlgorithms algorithm)
Constructor.
|
PrivateKeyFilePropertyType(Property<File> derivedFromFile,
KeyFactoryAlgorithms algorithm,
Class<? extends EncodedKeySpec> encodedKeySpecClass)
Constructor.
|
PrivateKeyFilePropertyType(Property<File> derivedFromFile,
String algorithm)
Constructor.
|
PrivateKeyFilePropertyType(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 PrivateKey |
validateKey(EncodedKeySpec spec)
Gets the PrivateKey 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 PrivateKeyFilePropertyType(Property<File> derivedFromFile, String algorithm, Class<? extends EncodedKeySpec> encodedKeySpecClass)
derivedFromFile - the property which returns the file where the PrivateKey is stored.algorithm - the name of the algortihm used.encodedKeySpecClass - the class used to encoded the bytes.EncodedKeySpec,
X509EncodedKeySpec,
PKCS8EncodedKeySpec,
KeyFactory,
KeyFactoryAlgorithmspublic PrivateKeyFilePropertyType(Property<File> derivedFromFile, KeyFactoryAlgorithms algorithm, Class<? extends EncodedKeySpec> encodedKeySpecClass)
derivedFromFile - the property which returns the file where the PrivateKey is stored.algorithm - the name of the algortihm used.encodedKeySpecClass - the class used to encoded the bytes.EncodedKeySpec,
X509EncodedKeySpec,
PKCS8EncodedKeySpec,
KeyFactory,
KeyFactoryAlgorithmspublic PrivateKeyFilePropertyType(Property<File> derivedFromFile, String algorithm)
PKCS8EncodedKeySpec.class as encodedKeySpecClass.derivedFromFile - the property which returns the file where the PrivateKey is stored.algorithm - the name of the algortihm used.EncodedKeySpec,
X509EncodedKeySpec,
PKCS8EncodedKeySpec,
KeyFactory,
KeyFactoryAlgorithmspublic PrivateKeyFilePropertyType(Property<File> derivedFromFile, KeyFactoryAlgorithms algorithm)
PKCS8EncodedKeySpec.class as encodedKeySpecClass.derivedFromFile - the property which returns the file where the PrivateKey is stored.algorithm - the enum of the algortihm used.NullPointerException - if algortihm is null.public List<String> getDerivedToRestrictions()
DerivedPropertyTypegetDerivedToRestrictions in class DerivedPropertyType<PrivateKey>protected PrivateKey validateKey(EncodedKeySpec spec) throws PropertyException
return getKeyFactory().generatePrivate(spec);
validateKey in class AbstractKeyPropertyType<PrivateKey>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.