public class Verifier
extends java.lang.Object
Verifier(Document, URI, String, String)Verifier(InputStream, URI, String, String)| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
addedNSDecls_
Contains all namespace nodes which have been added to
signatureDocOM_. |
protected iaik.ixsil.core.Signature |
signature_
Represents the XML signature itself.
|
protected org.w3c.dom.Document |
signatureDocOM_
Holds the object model (OM) representing the logical structure of the XML signature document.
|
protected java.lang.String |
signatureSelectorXPath_
XPath specifying the location of the XML Signature in the XML document, which is to be verified.
|
protected static boolean |
SIGNING_
Indicates the signature creation use case.
|
protected URIResolverParameters |
uriResolverParameters_
Structure encapsulating some parameters for resolving URIs within the IXSIL core.
|
protected boolean |
useCase_
Indicates if this object is used for signing or verifying.
|
protected boolean |
validated_
Shows if the signature document could have been parsed with validation on, or has been parsed with
validation off.
|
protected static boolean |
VERIFYING_
Indicates the signature verification use case.
|
| Constructor and Description |
|---|
Verifier(org.w3c.dom.Document signatureDocOM,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes)
Used to to verify an a XML signature, whereas the XML document which contains the signature is
specified as a document object model.
|
Verifier(org.w3c.dom.Document signatureDocOM,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
boolean reparseSignature)
Used to to verify an a XML signature, whereas the XML document which contains the signature is
specified as a DOM document.
|
Verifier(org.w3c.dom.Element signatureElement,
URI signatureDocBaseURI)
Used to verify an XML signature, whereas the XML signature is specified as a DOM element.
|
Verifier(org.w3c.dom.Element signatureElement,
URI signatureDocBaseURI,
boolean reparseSignature)
Used to verify an XML signature, whereas the XML signature is specified as a DOM element.
|
Verifier(java.io.InputStream signatureDocStream,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes)
Used to to verify an a XML signature, whereas the XML document which contains the signature is
specified as a input stream.
|
Verifier(java.io.InputStream signatureDocStream,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
java.lang.String noNamespaceSchemaLocation,
java.lang.String schemaLocations)
Used to to verify an a XML signature, whereas the XML document which contains the signature is
specified as a input stream.
|
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Document |
getDocument()
Gets the XML document embedding the XML signature as a DOM Document object.
|
java.util.Vector |
getRequiredUsers()
Allows the application to determine whether it needs to provide additional
User instances in order to verify this signature.
|
VerifierSignature |
getSignature()
Gets an interface to the signature object for the verification use case.
|
protected void |
initialize(org.w3c.dom.Element signatureElem,
java.lang.String additionalNoNamespaceSchemaLocation,
java.lang.String additionalSchemaLocations,
boolean reparseSignature)
Initializes this verifier object.
|
protected void |
initialize(java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
java.lang.String additionalNoNamespaceSchemaLocation,
java.lang.String additionalSchemaLocations,
boolean reparseSignature)
Initializes this verifier object.
|
protected void |
initResolvers()
Initializes the default implementations for the internal (
XPointerReferenceResolver) and
the external (ExternalReferenceResolverImpl) reference resolver. |
void |
setExternalRefResolver(ExternalReferenceResolverInterface externalRefResolver)
Sets the object which is responsible for resolving external URIs, i.
|
void |
setInternalRefResolver(InternalReferenceResolverInterface internalRefResolver)
Sets the object which is responsible for resolving internal URIs, i.
|
void |
setUser(User user)
A convenience method that allows the application to provide User instances
to all Decryption Transforms in this signature.
|
void |
setXMLEinitializer(XMLEInit initializer)
Initializes this Verifier instance so it can decrypt.
|
void |
withdrawDistributedNSDeclarations()
Removes namespace declarations which have eventually been inserted into the XML document bearing the
XML signature by IXSIL during signature creation or signature validation respectively.
|
protected java.lang.String signatureSelectorXPath_
protected iaik.ixsil.core.Signature signature_
protected static final boolean SIGNING_
protected static final boolean VERIFYING_
protected boolean validated_
protected org.w3c.dom.Document signatureDocOM_
protected URIResolverParameters uriResolverParameters_
protected boolean useCase_
protected java.util.List addedNSDecls_
signatureDocOM_. This member variable is
part of "TreeModelWorkaround".public Verifier(org.w3c.dom.Element signatureElement,
URI signatureDocBaseURI)
throws SignatureHandlerException
signatureElement - The XML element representing the XML signature to be verified. Must not be
null.signatureDocBaseURI - Holds the base URI for the signature document used to resolve relative URIs
in several cases. Must either be null or an absolute URI.SignatureHandlerException - if creating the verifier object fails for any reason.public Verifier(org.w3c.dom.Document signatureDocOM,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes)
throws SignatureHandlerException
signatureDocOM - The XML document bearing the XML signature to be verified, as a document object
model. Must not be null.signatureDocBaseURI - Holds the base URI for the signature document used to resolve relative URIs
in several cases. Must either be null or an absolute URI.signatureSelectorXPath - An XPath expression which is used to select the XML signature to be
verified. Evaluation of this XPath expression must result in a single
XML element representing the XML signature. Must not be null
.additionalNSPrefixes - Allows the specification of additional namespace prefixes which can be used
in the XPath expression. The value of the parameter consists of pairs of
prefix to namespace URI attributions separated by spaces, i. e. "
prefix1 uri1 prefix2 uri2 ...". May be null.SignatureHandlerException - if creating the verifier object fails for any reason.public Verifier(java.io.InputStream signatureDocStream,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes)
throws SignatureHandlerException
signatureDocStream - The XML document bearing the XML signature to be verified, as an input
stream. Must not be null.signatureDocBaseURI - Holds the base URI for the signature document used to resolve relative URIs
in several cases. Must either be null or an absolute URI.signatureSelectorXPath - An XPath expression which is used to select the XML signature to be
verified. Evaluation of this XPath expression must result in a single
XML element representing the XML signature. Must not be null
.additionalNSPrefixes - Allows the specification of additional namespace prefixes which can be used
in the XPath expression. The value of the parameter consists of pairs of
prefix to namespace URI attributions separated by spaces, i. e.
"prefix1 uri1 prefix2 uri2 ...". May be null.SignatureHandlerException - if creating the verifier object fails for any reason.public Verifier(java.io.InputStream signatureDocStream,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
java.lang.String noNamespaceSchemaLocation,
java.lang.String schemaLocations)
throws SignatureHandlerException
signatureDocStream - The XML document bearing the XML signature to be verified, as an input
stream. Must not be null.signatureDocBaseURI - Holds the base URI for the signature document used to resolve relative URIs
in several cases. Must either be null or an absolute URI.signatureSelectorXPath - An XPath expression which is used to select the XML signature to be
verified. Evaluation of this XPath expression must result in a single
XML element representing the XML signature. Must not be null
.additionalNSPrefixes - Allows the specification of additional namespace prefixes which can be used
in the XPath expression. The value of the parameter consists of pairs of
prefix to namespace URI attributions separated by spaces, i. e.
"prefix1 uri1 prefix2 uri2 ...". May be null.noNamespaceSchemaLocation - This URI string can be used to provide a Schema for the no-namespace
in cases where the DOM document should be created by a validating
parser (see also parameter validate). May be null
. Valid example: "http://repository.foo.org/mySchema.xsd".schemaLocations - This parameter can be used to provide schemas for various namespaces in cases
where the DOM document should be created by a validating parser (see also
parameter validate). Must either be null or conform
to the following rules:
additionalSchemas ::= additionalSchema (space additionalSchema)*
additionalSchema ::= schemaNamespaceURI space schemaLocationURI
For example, "http://foo.org/mySchema http://repository.foo.org/mySchema.xsd".SignatureHandlerException - if creating the verifier object fails for any reason.public Verifier(org.w3c.dom.Element signatureElement,
URI signatureDocBaseURI,
boolean reparseSignature)
throws SignatureHandlerException
signatureElement - See Verifier(Element, URI).signatureDocBaseURI - See Verifier(Element, URI).reparseSignature - Indicates wheter the signature element should be reparsed in order to detect
attributes of type ID. Reparsing makes sense in situations where the signature
makes use of ID attributes for referencing signed data, but the DOM document
containing the signature has been generated using a non-validating parser.SignatureHandlerException - if creating the verifier object fails for any reason.public Verifier(org.w3c.dom.Document signatureDocOM,
URI signatureDocBaseURI,
java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
boolean reparseSignature)
throws SignatureHandlerException
signatureDocOM - See Verifier(Document, URI, String, String).signatureDocBaseURI - See Verifier(Document, URI, String, String).signatureSelectorXPath - See Verifier(Document, URI, String, String).additionalNSPrefixes - See Verifier(Document, URI, String, String).reparseSignature - Indicates wheter the signature element should be reparsed in order to detect
attributes of type ID. Reparsing makes sense in situations where the signature
makes use of ID attributes for referencing signed data, but the DOM document
containing the signature has been generated using a non-validating parser.SignatureHandlerException - if creating the verifier object fails for any reason.public VerifierSignature getSignature()
public org.w3c.dom.Document getDocument()
public void setXMLEinitializer(XMLEInit initializer)
initializer - an XMLE initialization instanceTransformImplDecryption.setInitializer(XMLEInit)public void setUser(User user)
User instances provided by the application.user - a User that is already logged inTransformImplDecryption.setUser(User),
getRequiredUsers()public java.util.Vector getRequiredUsers()
If a verification failed, your application can invoke this method to determine whether
it should provide additional User instances to the Verifier,
so the Toolkit can decrypt some of the encrypted elements in the signed content. If
possible, the application should provide those User instances and attempt
to verify the signature again.
Verifier needs in order to verify this
signature, or an empty Vector if none is required.setUser(User user)protected void initialize(java.lang.String signatureSelectorXPath,
java.lang.String additionalNSPrefixes,
java.lang.String additionalNoNamespaceSchemaLocation,
java.lang.String additionalSchemaLocations,
boolean reparseSignature)
throws SignatureHandlerException
signatureSelectorXPath - An XPath expression which is used to select the XML signature to be
verified. Evaluation of this XPath expression must result in a single
XML element representing the XML signature.additionalNSPrefixes - Allows the specification of additional namespace prefixes which can be used
in the XPath expression. The value of the parameter consists of pairs of
prefix to namespace URI attributions separated by spaces, i. e.
"prefix1 uri1 prefix2 uri2 ...".additionalNoNamespaceSchemaLocation - In cases where the signature document is not available in
validated form this method validates at least the XML
signature element. The schema whose location is given by
this URI will be used for elements in the no-namespace
appearing in the content of Object or
SignatureProperty elements. May be null.
For example, "http://repository.foo.org/mySchema.xsd".additionalSchemaLocations - In cases where the signature document is not available in validated
form this method validates at least the XML signature element. The
schemas whose locations are given by this parameter will be used for
namespace qualified elements appearing in the content of Object
or SignatureProperty elements. Must either be
null or conform to the following rules:
additionalSchemas ::= additionalSchema (space additionalSchema)*
additionalSchema ::= schemaNamespaceURI space schemaLocationURI
For example,
"http://foo.org/mySchema http://repository.foo.org/mySchema.xsd".reparseSignature - Indicates wheter the signature element should be reparsed in order to detect
attributes of type ID. Reparsing makes sense in situations where the signature
makes use of ID attributes for referencing signed data, but the DOM document
containing the signature has been generated using a non-validating parser.SignatureHandlerException - if initializing this verifier object fails for any reason.protected void initialize(org.w3c.dom.Element signatureElem,
java.lang.String additionalNoNamespaceSchemaLocation,
java.lang.String additionalSchemaLocations,
boolean reparseSignature)
throws SignatureHandlerException
signatureElem - The XML element representing the XML signature to be verified.additionalNoNamespaceSchemaLocation - See initialize(String, String, String, String,
boolean).additionalSchemaLocations - See initialize(String, String, String, String, boolean).reparseSignature - Indicates wheter the signature element should be reparsed in order to detect
attributes of type ID. Reparsing makes sense in situations where the signature
makes use of ID attributes for referencing signed data, but the DOM document
containing the signature has been generated using a non-validating parser.SignatureHandlerException - if initializing this verifier object fails for any reason.public void setInternalRefResolver(InternalReferenceResolverInterface internalRefResolver)
InternalReferenceResolverImpl will be used.internalRefResolver - The object which is responsible for resolving internal URIs. Must not be
null.public void setExternalRefResolver(ExternalReferenceResolverInterface externalRefResolver)
ExternalReferenceResolverImpl) will be used.externalRefResolver - The object which is responsible for resolving external URIs. Must not be
null.protected void initResolvers()
XPointerReferenceResolver) and
the external (ExternalReferenceResolverImpl) reference resolver.public void withdrawDistributedNSDeclarations()