com.sap.security.core.server.ssf
Class SsfDataPKCS7

java.lang.Object
  |
  +--com.sap.security.core.server.ssf.SsfDataPKCS7
All Implemented Interfaces:
ISsfData

public class SsfDataPKCS7
extends java.lang.Object
implements ISsfData

Class for representing data to be digitally signed, verified, encrypted or decrypted, using PKCS#7 as security format.


Fields inherited from interface com.sap.security.api.ssf.ISsfData
ALG_AES128_CBC, ALG_DES_EDE3_CBC, ALG_MD5, ALG_RC2_40_CBC, ALG_RC2_CBC, ALG_SHA, INC_CERT_CHAIN, INC_CERT_CHAIN_ROOT, INC_CERT_NONE, INC_CERT_OWN
 
Constructor Summary
SsfDataPKCS7(java.io.InputStream in)
          Constructs PKCS#7 object from an InputStream
 
Method Summary
 boolean decrypt(ISsfProfile profile)
          Decrypts the given data.
 boolean encrypt(SsfSigRcpList rcpList, ISsfPab pab)
          Encrypts the given data.
 boolean encrypt(SsfSigRcpList rcpList, ISsfPab pab, java.lang.String symAlg)
          Encrypts the given data.
 byte[] getDataPKCS7()
          Get PKCS#7 data which results from previous operations
 boolean sign(ISsfProfile profile)
          Creates a digital siganture of the given data.
 boolean sign(ISsfProfile profile, java.lang.String mdAlg, int incCerts, boolean detached)
          Creates a digital siganture of the given data.
 java.lang.String toString()
          Get information about the PKCS#7 data
 boolean verify(ISsfPab pab, SsfSigRcpList sigList)
          Verifies a digital signature of the given data.
 boolean verify(ISsfPab pab, SsfSigRcpList sigList, ISsfData input, java.security.cert.X509Certificate cert)
          Verifies a digital signature of the given data.
 boolean writeTo(java.io.OutputStream out)
          Writes the changed data to an output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SsfDataPKCS7

public SsfDataPKCS7(java.io.InputStream in)
             throws java.io.IOException
Constructs PKCS#7 object from an InputStream
Parameters:
in - InputStream containing the data
Method Detail

sign

public boolean sign(ISsfProfile profile)
             throws SsfInvalidKeyException
Description copied from interface: ISsfData
Creates a digital siganture of the given data.
Specified by:
sign in interface ISsfData
See Also:
ISsfData.sign(com.sap.security.api.ssf.ISsfProfile)

sign

public boolean sign(ISsfProfile profile,
                    java.lang.String mdAlg,
                    int incCerts,
                    boolean detached)
             throws SsfInvalidKeyException,
                    SsfInvalidAlgException
Description copied from interface: ISsfData
Creates a digital siganture of the given data.
Specified by:
sign in interface ISsfData
See Also:
ISsfData.sign(com.sap.security.api.ssf.ISsfProfile)

verify

public boolean verify(ISsfPab pab,
                      SsfSigRcpList sigList)
               throws SsfInvalidDataException
Description copied from interface: ISsfData
Verifies a digital signature of the given data.
Specified by:
verify in interface ISsfData
See Also:
ISsfData.verify(com.sap.security.api.ssf.ISsfPab, com.sap.security.core.server.ssf.SsfSigRcpList)

verify

public boolean verify(ISsfPab pab,
                      SsfSigRcpList sigList,
                      ISsfData input,
                      java.security.cert.X509Certificate cert)
               throws SsfInvalidDataException
Description copied from interface: ISsfData
Verifies a digital signature of the given data.
Specified by:
verify in interface ISsfData
See Also:
ISsfData.verify(com.sap.security.api.ssf.ISsfPab, com.sap.security.core.server.ssf.SsfSigRcpList)

encrypt

public boolean encrypt(SsfSigRcpList rcpList,
                       ISsfPab pab)
                throws SsfInvalidKeyException
Description copied from interface: ISsfData
Encrypts the given data.
Specified by:
encrypt in interface ISsfData
See Also:
ISsfData.encrypt(com.sap.security.core.server.ssf.SsfSigRcpList, com.sap.security.api.ssf.ISsfPab)

encrypt

public boolean encrypt(SsfSigRcpList rcpList,
                       ISsfPab pab,
                       java.lang.String symAlg)
                throws SsfInvalidKeyException,
                       SsfInvalidAlgException
Description copied from interface: ISsfData
Encrypts the given data.
Specified by:
encrypt in interface ISsfData
See Also:
ISsfData.encrypt(com.sap.security.core.server.ssf.SsfSigRcpList, com.sap.security.api.ssf.ISsfPab)

decrypt

public boolean decrypt(ISsfProfile profile)
                throws SsfInvalidKeyException,
                       SsfInvalidDataException
Description copied from interface: ISsfData
Decrypts the given data.
Specified by:
decrypt in interface ISsfData
See Also:
ISsfData.decrypt(com.sap.security.api.ssf.ISsfProfile)

writeTo

public boolean writeTo(java.io.OutputStream out)
                throws java.io.IOException
Description copied from interface: ISsfData
Writes the changed data to an output stream
Specified by:
writeTo in interface ISsfData
See Also:
ISsfData.writeTo(java.io.OutputStream)

getDataPKCS7

public byte[] getDataPKCS7()
Get PKCS#7 data which results from previous operations
Returns:
PKCS#7 data

toString

public java.lang.String toString()
Get information about the PKCS#7 data
Overrides:
toString in class java.lang.Object
Returns:
string describing the PKCS#7 data