public class KeySignedFilePropertyType extends DerivedPropertyType<SignedFile> implements MarkerPathPropertyType
Property<File> signedDataFile = new Property<File>("p.data.file",new FilePropertyType()); Property<File> publicKeyFile = new Property<File>("p.publickey.file",new FilePropertyType()); Property<File> signatuteFile = new Property<File>("p.signature.file",new FilePropertyType()); // Property<PublicKey> publicKeyFromFile = new Property<PublicKey>("na.public.key.from.file",new PublicKeyFilePropertyType(publicKeyFile, "DSA")); Property<byte[]> signatureDataFile = new Property<byte[]>("na.p.signature.data",new BytesFromFilePropertyType(signatuteFile)); // Property<SignedFile> signedFile = new Property<SignedFile>("signed.file",new KeySignedFilePropertyType(signedDataFile,publicKeyFromFile,signatureDataFile));
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ALGORITHM
The default algorithm "SHA1withDSA".
|
static String |
DEFAULT_PROVIDER
The default Signature Provider "SUN".
|
static String |
TYPE |
Constructor and Description |
---|
KeySignedFilePropertyType(Property<File> signedFileProperty,
Property<PublicKey> publicKeyProperty,
Property<byte[]> signatureFileProperty)
Constructor using default algorithm "SHA1withDSA" and default provider "SUN".
|
KeySignedFilePropertyType(Property<File> signedFileProperty,
Property<PublicKey> publicKeyProperty,
Property<byte[]> signatureFileProperty,
String algorithm)
Constructor using default algorithm "SHA1withDSA".
|
KeySignedFilePropertyType(Property<File> signedFileProperty,
Property<PublicKey> publicKeyProperty,
Property<byte[]> signatureFileProperty,
String algorithm,
String provider)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
The algorithm.
|
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". |
String |
getProvider()
The provider
|
Property<PublicKey> |
getPublicKeyProperty() |
Property<byte[]> |
getSignatureProperty() |
Property<File> |
getSignedFileProperty() |
void |
validateConstraints(String propertyName)
Validates that :
PublicKey Property is not
null .
SignedFile Property is not null .
Signature Property is not null .
Algorithm is not null an not empty.
Provider is not null an not empty.
|
SignedFile |
validateDerivedValue(String propertyName)
Should convert the dependent Properties to the type T.
|
getDerivedFrom, getDerivedFromCount, getDerivedFromProperty, getDerivedFromRestrictions, getMaxDerivedFrom, getMinDerivedFrom, getRestrictions, isMinAndMaxTheSame, isUseMaxDerivedFrom, isUseMinDerivedFrom, validateValue
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateNullType
public static final String TYPE
public static final String DEFAULT_PROVIDER
public static final String DEFAULT_ALGORITHM
public KeySignedFilePropertyType(Property<File> signedFileProperty, Property<PublicKey> publicKeyProperty, Property<byte[]> signatureFileProperty)
signedFileProperty
- a Property returning a File pointing to the signed file.publicKeyProperty
- a Property returning a PublicKey file used to verifed the signed file.signatureFileProperty
- a Property returning a Signature file in form of a byte[] used to verifed the signed file.DEFAULT_ALGORITHM
,
DEFAULT_PROVIDER
public KeySignedFilePropertyType(Property<File> signedFileProperty, Property<PublicKey> publicKeyProperty, Property<byte[]> signatureFileProperty, String algorithm)
signedFileProperty
- a Property returning a File pointing to the signed file.publicKeyProperty
- a Property returning a PublicKey file used to verifed the signed file.signatureFileProperty
- a Property returning a Signature file in form of a byte[] used to verifed the signed file.algorithm
- the algorithm used.DEFAULT_PROVIDER
public KeySignedFilePropertyType(Property<File> signedFileProperty, Property<PublicKey> publicKeyProperty, Property<byte[]> signatureFileProperty, String algorithm, String provider)
signedFileProperty
- a Property returning a File pointing to the signed file.publicKeyProperty
- a Property returning a PublicKey file used to verifed the signed file.signatureFileProperty
- a Property returning a Signature file in form of a byte[] used to verifed the signed file.algorithm
- the algorithm used.provider
- the provider used.public Property<byte[]> getSignatureProperty()
public String getAlgorithm()
public String getProvider()
public List<String> getDerivedToRestrictions()
DerivedPropertyType
getDerivedToRestrictions
in class DerivedPropertyType<SignedFile>
public SignedFile validateDerivedValue(String propertyName) throws PropertyException
DerivedPropertyType
validateDerivedValue
in class DerivedPropertyType<SignedFile>
propertyName
- the name of derived PropertyPropertyException
- if it could not be converted into type T.public void validateConstraints(String propertyName) throws PropertyException
null
.null
.null
.null
an not empty.null
an not empty.validateConstraints
in class DerivedPropertyType<SignedFile>
propertyName
- the name of the property used for logging purposes, to
identify the unique property which PropertyType has constraint
issues.PropertyException
- if the constraints have invalid/conflicting values.Property.validate()