XmlDsigLevel
Contents
[
Hide
]Inheritance: java.lang.Object
public class XmlDsigLevel
Specifies the level of a digital signature based on XML-DSig standard.
Examples:
Shows how to sign document based on XML-DSig standard.
CertificateHolder certificateHolder = CertificateHolder.create(getMyDir() + "morzal.pfx", "aw");
SignOptions signOptions = new SignOptions(); { signOptions.setXmlDsigLevel(XmlDsigLevel.X_AD_ES_EPES); }
String inputFileName = getMyDir() + "Document.docx";
String outputFileName = getArtifactsDir() + "DigitalSignatureUtil.XmlDsig.docx";
DigitalSignatureUtil.sign(inputFileName, outputFileName, certificateHolder, signOptions);
Fields
| Field | Description |
|---|---|
| XML_D_SIG | Specifies XML-DSig signature level. |
| X_AD_ES_EPES | Specifies XAdES-EPES signature level. |
| length |
Methods
| Method | Description |
|---|---|
| fromName(String xmlDsigLevelName) | |
| getName(int xmlDsigLevel) | |
| getValues() | |
| toString(int xmlDsigLevel) |
XML_D_SIG
public static int XML_D_SIG
Specifies XML-DSig signature level.
Remarks:
A simple digital signature that should not be trusted after its signing certificate expires.
X_AD_ES_EPES
public static int X_AD_ES_EPES
Specifies XAdES-EPES signature level.
Remarks:
Adds information about the signing certificate to the XML-DSig signature. A malicious user cannot switch the signing certificate for another certificate with the same public/private key.
length
public static int length
fromName(String xmlDsigLevelName)
public static int fromName(String xmlDsigLevelName)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| xmlDsigLevelName | java.lang.String |
Returns: int
getName(int xmlDsigLevel)
public static String getName(int xmlDsigLevel)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| xmlDsigLevel | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int xmlDsigLevel)
public static String toString(int xmlDsigLevel)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| xmlDsigLevel | int |
Returns: java.lang.String