Class XMLSignatureDocument
java.lang.Object
es.uji.crypto.xades.jxades.security.xml.XMLSignatureDocument
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Element
private List
<SignatureProperty> private String
private String
private String
private List
<XMLStructure> private String
private DigestMethod
private List
<SignatureProperties> private XmlWrappedKeyInfo
private XMLSignatureFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSignatureProperty
(List<DOMStructure> content, String target, String id) void
addSignatureProperty
(SignatureProperty signatureProperty) addXMLObject
(List<XMLStructure> xmlObjects) addXMLObject
(XMLObject xmlObject) void
addXMLObjectItem
(XMLStructure xmlObjectItem) protected String
getKeyInfoId
(String idPrefix) protected Reference
getReference
(String uri) protected Reference
getReference
(String uri, String type) protected Reference
getReference
(String uri, List transforms, String type) protected Reference
getReference
(String uri, List transforms, String type, String referenceId) getReferences
(List idList) protected String
getSignatureId
(String idPrefix) protected String
getSignatureValueId
(String idPrefix) protected XMLSignatureFactory
private static Document
newKeyInfo
(X509Certificate certificate, String keyInfoId) newXMLObject
(List<XMLStructure> xmlObjects) newXMLObject
(List<XMLStructure> xmlObjects, String id) newXMLObject
(List<XMLStructure> xmlObjects, String id, String mimeType) newXMLObject
(List<XMLStructure> xmlObjects, String id, String mimeType, String encoding) static void
printDocument
(Node node) void
void
setDefaultXMLObjectEncoding
(String defaultXMLObjectEncoding) void
setDefaultXMLObjectId
(String defaultXMLObjectId) void
setDefaultXMLObjectMimeType
(String defaultXMLObjectMimeType) void
setDigestMethod
(DigestMethod digestMethod) void
setListOfSignatureProperties
(List<SignatureProperties> listOfSignatureProperties) void
setWrappedKeyStorePlace
(WrappedKeyStorePlace wrappedKeyStorePlace) void
setXmlWrappedKeyInfo
(XmlWrappedKeyInfo wrappedKeyInfo) void
sign
(X509Certificate certificate, PrivateKey privateKey, String signatureMethod, List referencesIdList, String signatureIdPrefix, String xadesPrefix, String xadesNamespace, String xmlSignaturePrefix) validate()
-
Field Details
-
baseElement
-
xmlSignatureFactory
-
digestMethod
-
wrappedKeyInfo
-
listOfSignatureProperties
-
defaultSignatureProperties
-
defaultSignaturePropertiesId
-
xmlObjects
-
defaultXMLObjectItems
-
defaultXMLObjectId
-
defaultXMLObjectMimeType
-
defaultXMLObjectEncoding
-
-
Constructor Details
-
XMLSignatureDocument
-
-
Method Details
-
getBaseElement
-
getXMLSignatureFactory
-
getDigestMethod
- Throws:
GeneralSecurityException
-
setDigestMethod
-
getXMLSignatureElements
-
getXmlWrappedKeyInfo
-
setXmlWrappedKeyInfo
-
getWrappedKeyStorePlace
-
setWrappedKeyStorePlace
-
getReference
- Throws:
GeneralSecurityException
-
getReference
- Throws:
GeneralSecurityException
-
getReference
protected Reference getReference(String uri, List transforms, String type) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
getReference
protected Reference getReference(String uri, List transforms, String type, String referenceId) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
getReferences
- Throws:
GeneralSecurityException
-
validate
-
sign
public void sign(X509Certificate certificate, PrivateKey privateKey, String signatureMethod, List referencesIdList, String signatureIdPrefix, String xadesPrefix, String xadesNamespace, String xmlSignaturePrefix) throws MarshalException, XMLSignatureException, GeneralSecurityException -
getSignatureId
-
getSignatureValueId
-
getKeyInfoId
-
newKeyInfo
- Throws:
KeyException
-
getListOfSignatureProperties
-
setListOfSignatureProperties
-
addSignatureProperty
-
addSignatureProperty
-
getDefaultSignatureProperties
-
setDefaultSignaturePropertiesId
-
getDefaultSignaturePropertiesId
-
newXMLObject
-
newXMLObject
-
newXMLObject
-
newXMLObject
-
addXMLObject
-
addXMLObject
-
getXMLObjects
-
addXMLObjectItem
-
getDefaultXMLObject
-
getXMLObjectItems
-
setDefaultXMLObjectId
-
getDefaultXMLObjectId
-
setDefaultXMLObjectMimeType
-
getDefaultXMLObjectMimeType
-
setDefaultXMLObjectEncoding
-
getDefaultXMLObjectEncoding
-
loadEncryptionDocument
- Throws:
Exception
-
printDocument
- Throws:
TransformerException
-