Java Doc for SignatureHeaderBlock.java in  » 6.0-JDK-Modules-com.sun » xws-security » com » sun » xml » wss » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules com.sun » xws security » com.sun.xml.wss.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.xml.wss.impl.misc.SecurityHeaderBlockImpl
   com.sun.xml.wss.core.SignatureHeaderBlock

SignatureHeaderBlock
public class SignatureHeaderBlock extends SecurityHeaderBlockImpl (Code)


Field Summary
final public static  StringSignatureSpecNS
    
final public static  StringSignatureSpecNSprefix
    
final public static  StringTAG_SIGNATURE
    
 StringbaseURI
     baseURI URI to be used as context for all relative URIs.
 XMLSignaturedelegateSignature
    
 booleandirty
    

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  voidaddSignedInfoReference(String referenceURI, Transforms transforms)
     Adds a Reference with just the URI and the transforms.
public  voidaddSignedInfoReference(String referenceURI, Transforms trans, String digestURI)
    
public  voidaddSignedInfoReference(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  voidappendObject(SOAPElement object)
     Method appendObject.
public  booleancheckSignatureValue(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  booleancheckSignatureValue(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  SecurityHeaderBlockfromSoapElement(SOAPElement element)
    
public  SOAPElementgetAsSoapElement()
    
public  SignedInfogetDSSignedInfo()
    
public  StringgetId()
    
public  SOAPElementgetKeyInfo()
     Returns the KeyInfo child.
public  KeyInfoHeaderBlockgetKeyInfoHeaderBlock()
     Returns the KeyInfo as a HeaderBlock.
public  intgetObjectCount()
     Returns the number of all ds:Object elements.
public  SOAPElementgetObjectItem(int index)
     Returns the indexth ds:Object child of the signature or null if no such ds:Object element exists.
public  XMLSignaturegetSignature()
    
public  byte[]getSignatureValue()
    
public  SOAPElementgetSignedInfo()
     Returns the completely parsed SignedInfo object.
public  voidsaveChanges()
     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  voidsetApacheResourceResolver(ResourceResolverSpi resolver)
    
public  voidsetBaseURI(String uri)
    
public  voidsetDocument(Document doc)
     setDocument.
public  voidsetId(String id)
    
public  voidsign(Key signingKey)
     Digests all References in the SignedInfo, calculates the signature value and sets it in the SignatureValue Element.

Field Detail
SignatureSpecNS
final public static String SignatureSpecNS(Code)



SignatureSpecNSprefix
final public static String SignatureSpecNSprefix(Code)



TAG_SIGNATURE
final public static String TAG_SIGNATURE(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)



dirty
boolean dirty(Code)




Constructor Detail
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 -




Method Detail
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 -



appendObject
public void appendObject(SOAPElement object) throws XWSSecurityException(Code)
Method appendObject.



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 -



fromSoapElement
public static SecurityHeaderBlock fromSoapElement(SOAPElement element) throws XWSSecurityException(Code)



getAsSoapElement
public SOAPElement getAsSoapElement() throws XWSSecurityException(Code)
Method to return the Signature as a SOAPElement SOAPElement
throws:
  XWSSecurityException - If owner soap document is not set.
See Also:   SignatureHeaderBlock.setDocument(Document)



getDSSignedInfo
public SignedInfo getDSSignedInfo()(Code)



getId
public String getId()(Code)
Method getId the id



getKeyInfo
public SOAPElement getKeyInfo() throws XWSSecurityException(Code)
Returns the KeyInfo child. the KeyInfo object



getKeyInfoHeaderBlock
public KeyInfoHeaderBlock getKeyInfoHeaderBlock() throws XWSSecurityException(Code)
Returns the KeyInfo as a HeaderBlock. the KeyInfoHeaderBlock object



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



getSignatureValue
public byte[] getSignatureValue() throws XWSSecurityException(Code)
Method getSignatureValue
throws:
  XWSSecurityException -



getSignedInfo
public SOAPElement getSignedInfo() throws XWSSecurityException(Code)
Returns the completely parsed SignedInfo object. the SignedInfo as a SOAPElement



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



setId
public void setId(String id)(Code)
Method setId



sign
public void sign(Key signingKey) throws XWSSecurityException(Code)
Digests all References in the SignedInfo, calculates the signature value and sets it in the SignatureValue Element.
Parameters:
  signingKey - the java.security.PrivateKey or javax.crypto.SecretKey that is used to sign.
throws:
  XWSSecurityException -



Fields inherited from com.sun.xml.wss.impl.misc.SecurityHeaderBlockImpl
protected SOAPElement delegateElement(Code)(Java Doc)

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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.