com.sun.ebxml.registry.security
Class SecurityUtil

java.lang.Object
  |
  +--com.sun.ebxml.registry.security.SecurityUtil

public class SecurityUtil
extends java.lang.Object

Some utility methods related to XML security $Header: /cvsroot/ebxmlrr/ebxmlrr/src/share/com/sun/ebxml/registry/security/SecurityUtil.java,v 1.19 2002/11/29 12:34:55 farrukh_najmi Exp $


Constructor Summary
protected SecurityUtil()
           
 
Method Summary
static SecurityUtil getInstance()
           
static void main(java.lang.String[] unused)
          Method main
 void signPayload(javax.mail.internet.MimeMultipart mp, java.lang.String id, java.io.OutputStream payloadSigStream, java.security.PrivateKey privateKey, java.security.cert.Certificate cert, java.lang.String signingAlgo)
          Sign the payload, and the payload signature is put in the destination connected by the payloadSigStream parameter.
 void signSOAPMessage(java.io.InputStream soapStream, java.io.OutputStream signedSoapStream, java.security.PrivateKey privateKey, java.security.cert.Certificate[] certs, java.lang.String signatureAlgo)
          Sign the SOAP messasge
 boolean verifyPayloadSignature(java.lang.String id, javax.mail.internet.MimeMultipart multipart)
           
 org.apache.xml.security.signature.XMLSignature verifySOAPMessage(javax.xml.soap.SOAPMessage msg)
           
protected  boolean verifyXMLSignature(org.apache.xml.security.signature.XMLSignature signature)
          It expects the XMLSignature has been add ResourceResolver appropriately
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityUtil

protected SecurityUtil()
Method Detail

signSOAPMessage

public void signSOAPMessage(java.io.InputStream soapStream,
                            java.io.OutputStream signedSoapStream,
                            java.security.PrivateKey privateKey,
                            java.security.cert.Certificate[] certs,
                            java.lang.String signatureAlgo)
                     throws RegistryException
Sign the SOAP messasge

Parameters:
soapStream - is the InputStream to String representation of the SOAPMessage
signedSoapStream - is the OutputStream for signed SOAPMessage of String representation
certs - the certificate chain for verifying the signature
RegistryException

signPayload

public void signPayload(javax.mail.internet.MimeMultipart mp,
                        java.lang.String id,
                        java.io.OutputStream payloadSigStream,
                        java.security.PrivateKey privateKey,
                        java.security.cert.Certificate cert,
                        java.lang.String signingAlgo)
                 throws RegistryException
Sign the payload, and the payload signature is put in the destination connected by the payloadSigStream parameter.

Parameters:
payloadSigStream - the destination connected by this OutputStream contains the payload signature
RegistryException

verifySOAPMessage

public org.apache.xml.security.signature.XMLSignature verifySOAPMessage(javax.xml.soap.SOAPMessage msg)
                                                                 throws RegistryException
RegistryException

verifyXMLSignature

protected boolean verifyXMLSignature(org.apache.xml.security.signature.XMLSignature signature)
                              throws RegistryException,
                                     org.apache.xml.security.keys.keyresolver.KeyResolverException,
                                     java.lang.Exception
It expects the XMLSignature has been add ResourceResolver appropriately

RegistryException
org.apache.xml.security.keys.keyresolver.KeyResolverException
java.lang.Exception

verifyPayloadSignature

public boolean verifyPayloadSignature(java.lang.String id,
                                      javax.mail.internet.MimeMultipart multipart)
                               throws RegistryException
RegistryException

main

public static void main(java.lang.String[] unused)
                 throws java.lang.Exception
Method main

Parameters:
unused -
Throws:
java.lang.Exception

getInstance

public static SecurityUtil getInstance()


Copyright © 2001-2003 OASIS. All Rights Reserved.