/**
*
*/
package at.gv.egiz.pdfas.impl.api.commons;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Set;
import at.gv.egiz.pdfas.api.commons.SignatureProfile;
/**
* Holds the data of a signature profile.
*
* @author wprinz
*/
public class SignatureProfileImpl implements SignatureProfile
{
/**
* The profile identifier.
*/
protected String profileId = null;
/**
* The MOA key identifiert of this profile.
*/
protected String moaKeyIdentifier = null;
// start - added by tknall
/**
* A Hashtable containing all field values (as String) for the current profiles
* (sig_obj.PROFILE.key.*
).
*/
protected Hashtable fields = new Hashtable();
// stop - added by tknall
/**
* Constructor.
*
* @param profileId
* The profile identifier.
* @param moaKeyIdentifier
* The MOA key identifiert of this profile.
*/
public SignatureProfileImpl(String profileId, String moaKeyIdentifier)
{
this.profileId = profileId;
this.moaKeyIdentifier = moaKeyIdentifier;
}
/**
* @see at.gv.egiz.pdfas.api.commons.SignatureProfile#getProfileId()
*/
public String getProfileId()
{
return this.profileId;
}
/**
* @see at.gv.egiz.pdfas.api.commons.SignatureProfile#getMOAKeyIdentifier()
*/
public String getMOAKeyIdentifier()
{
return this.moaKeyIdentifier;
}
// start - added by tknall
/**
* Returns the value of a field with a given key for the current profile.
*
e.g.signaturProfile.getField(SignatureTypes.SIG_ISSUER)
* returns "Issuer-Certificate"
null
is returned if a field with key key
could not be found.
* @param key The key for the field to be returned or null
if there is not such field.
* @return The value of the field with key key.
* @see at.knowcenter.wag.egov.egiz.sig.SignatureTypes
*/
public String getField(String key) {
return (String) this.fields.get(key);
}
/**
* Sets the value value
for a certain field with key key
.
* @param key The key of the field.
* @param value The value of the field with key key
.
*/
public void setField(String key, String value) {
this.fields.put(key, value);
}
public Set getFieldKeys() {
return Collections.unmodifiableSet(this.fields.keySet());
}
// stop - added by tknall
}