| com.sun.xml.wss.impl.misc.SecurityHeaderBlockImpl com.sun.xml.wss.core.SignatureHeaderBlock
Constructor Summary | |
public | SignatureHeaderBlock(SOAPElement elem) parse and create the Signature element
Parameters: elem - the element representing an XML SignatureNOTE : this constructor assumes a fully initialized XML SignatureNo modifications are allowed on the signature, We can only get existingvalues. | public | SignatureHeaderBlock(XMLSignature signature) constructor that takes Apache Signature
Parameters: signature - the XMLSignature from XML DSIGNOTE : No modifications are allowed on the signature, if a SIGN operation has already been performed on the argumentsignature. | public | SignatureHeaderBlock(Document doc, String signatureMethodURI) This creates a new ds:Signature Element and adds an empty
ds:SignedInfo .
The ds:SignedInfo is initialized with the specified
Signature algorithm and Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS
which is RECOMMENDED by the spec. |
Method Summary | |
public void | addSignedInfoReference(String referenceURI, Transforms transforms) Adds a Reference with just the URI and the transforms. | public void | addSignedInfoReference(String referenceURI, Transforms trans, String digestURI) | public void | addSignedInfoReference(String referenceURI, Transforms trans, String digestURI, String referenceId, String referenceType) Add a Reference with full parameters to this Signature
Parameters: referenceURI - URI of the resource to be signed.Can be null in which case the dereferencing is application specific. | public void | appendObject(SOAPElement object) Method appendObject. | public boolean | checkSignatureValue(X509Certificate cert) Extracts the public key from the certificate and verifies if the
signature is valid by re-digesting all References, comparing those
against the stored DigestValues and then checking to see if the
Signatures match on the SignedInfo.
Parameters: cert - Certificate that contains the public key part of the keypair that was used to sign. | public boolean | checkSignatureValue(Key pk) Verifies if the signature is valid by redigesting all References,
comparing those against the stored DigestValues and then checking to see
if the Signatures match on the SignedInfo. | public static SecurityHeaderBlock | fromSoapElement(SOAPElement element) | public SOAPElement | getAsSoapElement() | public SignedInfo | getDSSignedInfo() | public String | getId() | public SOAPElement | getKeyInfo() Returns the KeyInfo child. | public KeyInfoHeaderBlock | getKeyInfoHeaderBlock() Returns the KeyInfo as a HeaderBlock. | public int | getObjectCount() Returns the number of all ds:Object elements. | public SOAPElement | getObjectItem(int index) Returns the indexth ds:Object child of the
signature or null if no such ds:Object element exists. | public XMLSignature | getSignature() | public byte[] | getSignatureValue() | public SOAPElement | getSignedInfo() Returns the completely parsed SignedInfo object. | public void | saveChanges() This method should be called when changes are made inside an object
through its reference obtained from any of the get methods of this
class. | public void | setApacheResourceResolver(ResourceResolverSpi resolver) | public void | setBaseURI(String uri) | public void | setDocument(Document doc) setDocument. | public void | setId(String id) | public void | sign(Key signingKey) Digests all References in the SignedInfo, calculates the signature
value and sets it in the SignatureValue Element. |
SignatureSpecNS | final public static String SignatureSpecNS(Code) | | |
SignatureSpecNSprefix | final public static String SignatureSpecNSprefix(Code) | | |
baseURI | String baseURI(Code) | | baseURI URI to be used as context for all relative URIs.
Accepted by all Apache XMLSIG elements
|
delegateSignature | XMLSignature delegateSignature(Code) | | |
SignatureHeaderBlock | public SignatureHeaderBlock(SOAPElement elem) throws XWSSecurityException(Code) | | parse and create the Signature element
Parameters: elem - the element representing an XML SignatureNOTE : this constructor assumes a fully initialized XML SignatureNo modifications are allowed on the signature, We can only get existingvalues. For example appendObject() would throw an Exception. Ifa KeyInfo was not present in the signature, then calling getKeyInfo()will not append a KeyInfo child to the signature. |
SignatureHeaderBlock | public SignatureHeaderBlock(XMLSignature signature) throws XWSSecurityException(Code) | | constructor that takes Apache Signature
Parameters: signature - the XMLSignature from XML DSIGNOTE : No modifications are allowed on the signature, if a SIGN operation has already been performed on the argumentsignature. We can only get existing values. For example appendObject() would throw an Exception. If a KeyInfo was not present in the signature, then calling getKeyInfo()will not append a KeyInfo child to the signature. |
SignatureHeaderBlock | public SignatureHeaderBlock(Document doc, String signatureMethodURI) throws XWSSecurityException(Code) | | This creates a new ds:Signature Element and adds an empty
ds:SignedInfo .
The ds:SignedInfo is initialized with the specified
Signature algorithm and Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS
which is RECOMMENDED by the spec. This method's main use is for creating
a new signature.
Parameters: doc - The OwnerDocument of signature Parameters: signatureMethodURI - signature algorithm to use. throws: XWSSecurityException - |
addSignedInfoReference | public void addSignedInfoReference(String referenceURI, Transforms transforms) throws XWSSecurityException(Code) | | Adds a Reference with just the URI and the transforms. This uses the
SHA1 algorithm as a default digest algorithm.
Parameters: referenceURI - URI according to the XML Signature specification. Parameters: transforms - List of transformations to be applied. throws: XWSSecurityException - |
addSignedInfoReference | public void addSignedInfoReference(String referenceURI, Transforms trans, String digestURI) throws XWSSecurityException(Code) | | Adds a Reference with URI, transforms and Digest algorithm URI
Parameters: referenceURI - URI according to the XML Signature specification. Parameters: trans - List of transformations to be applied. Parameters: digestURI - URI of the digest algorithm to be used. throws: XWSSecurityException - |
addSignedInfoReference | public void addSignedInfoReference(String referenceURI, Transforms trans, String digestURI, String referenceId, String referenceType) throws XWSSecurityException(Code) | | Add a Reference with full parameters to this Signature
Parameters: referenceURI - URI of the resource to be signed.Can be null in which case the dereferencing is application specific. Can be "" in which it'sthe parent node (or parent document?). There can only be one "" in eachsignature. Parameters: trans - Optional list of transformations to be done before digesting Parameters: digestURI - Mandatory URI of the digesting algorithm to use. Parameters: referenceId - Optional id attribute for this Reference Parameters: referenceType - Optional mimetype for the URI throws: XWSSecurityException - |
checkSignatureValue | public boolean checkSignatureValue(X509Certificate cert) throws XWSSecurityException(Code) | | Extracts the public key from the certificate and verifies if the
signature is valid by re-digesting all References, comparing those
against the stored DigestValues and then checking to see if the
Signatures match on the SignedInfo.
Parameters: cert - Certificate that contains the public key part of the keypair that was used to sign. true if the signature is valid, false otherwise throws: XWSSecurityException - |
checkSignatureValue | public boolean checkSignatureValue(Key pk) throws XWSSecurityException(Code) | | Verifies if the signature is valid by redigesting all References,
comparing those against the stored DigestValues and then checking to see
if the Signatures match on the SignedInfo.
Parameters: pk - java.security.PublicKey part of the keypair or javax.crypto.SecretKey that was used to sign true if the signature is valid, false otherwise throws: XWSSecurityException - |
getDSSignedInfo | public SignedInfo getDSSignedInfo()(Code) | | |
getObjectCount | public int getObjectCount()(Code) | | Returns the number of all ds:Object elements.
the number of all ds:Object elements. |
getObjectItem | public SOAPElement getObjectItem(int index) throws XWSSecurityException(Code) | | Returns the indexth ds:Object child of the
signature or null if no such ds:Object element exists.
Parameters: index - the indexth ds:Object child of the signature or null if no such ds:Object element exists.1 is the lowest index (not 0) |
getSignature | public XMLSignature getSignature()(Code) | | return the Apache XML Signature corresponding to this Block
the XMLSignature |
saveChanges | public void saveChanges()(Code) | | This method should be called when changes are made inside an object
through its reference obtained from any of the get methods of this
class. As an example, if getKeyInfo() call is made and then changes are made
inside the keyInfo, this method should be called to reflect changes
when getAsSoapElement() is called finally.
|
setApacheResourceResolver | public void setApacheResourceResolver(ResourceResolverSpi resolver)(Code) | | |
setBaseURI | public void setBaseURI(String uri)(Code) | | Method setBaseURI : BaseURI needed by Apache KeyInfo Ctor
Parameters: uri - URI to be used as context for all relative URIs. |
setDocument | public void setDocument(Document doc)(Code) | | setDocument.
Parameters: doc - The owner Document of this Signature |
Methods inherited from com.sun.xml.wss.impl.misc.SecurityHeaderBlockImpl | public SOAPElement addAttribute(Name arg0, String arg1) throws SOAPException(Code)(Java Doc) public SOAPElement addChildElement(String arg0) throws SOAPException(Code)(Java Doc) public SOAPElement addChildElement(String arg0, String arg1) throws SOAPException(Code)(Java Doc) public SOAPElement addChildElement(String arg0, String arg1, String arg2) throws SOAPException(Code)(Java Doc) public SOAPElement addChildElement(Name arg0) throws SOAPException(Code)(Java Doc) public SOAPElement addChildElement(SOAPElement arg0) throws SOAPException(Code)(Java Doc) public SOAPElement addNamespaceDeclaration(String arg0, String arg1) throws SOAPException(Code)(Java Doc) public SOAPElement addTextNode(String arg0) throws SOAPException(Code)(Java Doc) public Node appendChild(Node arg0) throws DOMException(Code)(Java Doc) public Node cloneNode(boolean arg0)(Code)(Java Doc) public short compareDocumentPosition(org.w3c.dom.Node other) throws DOMException(Code)(Java Doc) public void detachNode()(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public static SecurityHeaderBlock fromSoapElement(SOAPElement element, Class implClass) throws XWSSecurityException(Code)(Java Doc) public Iterator getAllAttributes()(Code)(Java Doc) public Iterator getAllAttributesAsQNames()(Code)(Java Doc) public SOAPElement getAsSoapElement() throws XWSSecurityException(Code)(Java Doc) public String getAttribute(String arg0)(Code)(Java Doc) public String getAttributeNS(String arg0, String arg1)(Code)(Java Doc) public Attr getAttributeNode(String arg0)(Code)(Java Doc) public Attr getAttributeNodeNS(String arg0, String arg1)(Code)(Java Doc) public String getAttributeValue(Name arg0)(Code)(Java Doc) public NamedNodeMap getAttributes()(Code)(Java Doc) public String getBaseURI()(Code)(Java Doc) public Iterator getChildElements()(Code)(Java Doc) public Iterator getChildElements(Name arg0)(Code)(Java Doc) public NodeList getChildNodes()(Code)(Java Doc) public Name getElementName()(Code)(Java Doc) public NodeList getElementsByTagName(String arg0)(Code)(Java Doc) public NodeList getElementsByTagNameNS(String arg0, String arg1)(Code)(Java Doc) public String getEncodingStyle()(Code)(Java Doc) public Object getFeature(String feature, String version)(Code)(Java Doc) public Node getFirstChild()(Code)(Java Doc) public String getId()(Code)(Java Doc) public Node getLastChild()(Code)(Java Doc) public String getLocalName()(Code)(Java Doc) public Iterator getNamespacePrefixes()(Code)(Java Doc) public String getNamespaceURI()(Code)(Java Doc) public String getNamespaceURI(String arg0)(Code)(Java Doc) public Node getNextSibling()(Code)(Java Doc) public String getNodeName()(Code)(Java Doc) public short getNodeType()(Code)(Java Doc) public String getNodeValue() throws DOMException(Code)(Java Doc) public Document getOwnerDocument()(Code)(Java Doc) public SOAPElement getParentElement()(Code)(Java Doc) public Node getParentNode()(Code)(Java Doc) public String getPrefix()(Code)(Java Doc) public Node getPreviousSibling()(Code)(Java Doc) public TypeInfo getSchemaTypeInfo()(Code)(Java Doc) protected static SOAPFactory getSoapFactory()(Code)(Java Doc) public String getTagName()(Code)(Java Doc) public String getTextContent() throws DOMException(Code)(Java Doc) public Object getUserData(String key)(Code)(Java Doc) public String getValue()(Code)(Java Doc) public Iterator getVisibleNamespacePrefixes()(Code)(Java Doc) public boolean hasAttribute(String arg0)(Code)(Java Doc) public boolean hasAttributeNS(String arg0, String arg1)(Code)(Java Doc) public boolean hasAttributes()(Code)(Java Doc) public boolean hasChildNodes()(Code)(Java Doc) public Node insertBefore(Node arg0, Node arg1) throws DOMException(Code)(Java Doc) public void isBSP(boolean flag)(Code)(Java Doc) public boolean isBSP()(Code)(Java Doc) public boolean isDefaultNamespace(String namespaceURI)(Code)(Java Doc) public boolean isEqualNode(org.w3c.dom.Node arg)(Code)(Java Doc) public boolean isSameNode(org.w3c.dom.Node other)(Code)(Java Doc) public boolean isSupported(String arg0, String arg1)(Code)(Java Doc) public String lookupNamespaceURI(String prefix)(Code)(Java Doc) public String lookupPrefix(String namespaceURI)(Code)(Java Doc) public void normalize()(Code)(Java Doc) public void recycleNode()(Code)(Java Doc) public void removeAttribute(String arg0) throws DOMException(Code)(Java Doc) public boolean removeAttribute(Name arg0)(Code)(Java Doc) public void removeAttributeNS(String arg0, String arg1) throws DOMException(Code)(Java Doc) public Attr removeAttributeNode(Attr arg0) throws DOMException(Code)(Java Doc) public Node removeChild(Node arg0) throws DOMException(Code)(Java Doc) public void removeContents()(Code)(Java Doc) public boolean removeNamespaceDeclaration(String arg0)(Code)(Java Doc) public Node replaceChild(Node arg0, Node arg1) throws DOMException(Code)(Java Doc) public void setAttribute(String arg0, String arg1) throws DOMException(Code)(Java Doc) public void setAttributeNS(String arg0, String arg1, String arg2) throws DOMException(Code)(Java Doc) public Attr setAttributeNode(Attr arg0) throws DOMException(Code)(Java Doc) public Attr setAttributeNodeNS(Attr arg0) throws DOMException(Code)(Java Doc) public void setEncodingStyle(String arg0) throws SOAPException(Code)(Java Doc) public void setIdAttribute(String name, boolean isId) throws DOMException(Code)(Java Doc) public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException(Code)(Java Doc) public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException(Code)(Java Doc) public void setNodeValue(String arg0) throws DOMException(Code)(Java Doc) public void setParentElement(SOAPElement arg0) throws SOAPException(Code)(Java Doc) public void setPrefix(String arg0) throws DOMException(Code)(Java Doc) protected void setSOAPElement(SOAPElement delegateElement)(Code)(Java Doc) public void setTextContent(String textContent) throws DOMException(Code)(Java Doc) public Object setUserData(String key, Object data, UserDataHandler handler)(Code)(Java Doc) public void setValue(String arg0)(Code)(Java Doc) protected void setWsuIdAttr(Element element, String wsuId)(Code)(Java Doc)
|
|
|