public class DumpMessage extends java.lang.Object
private key
can be statically
set to decrypt an encrypted content part.Constructor and Description |
---|
DumpMessage()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dump(java.lang.Object o)
Dumps the given object (message, part,...) to System.out.
|
void |
dumpAuthEncrypted(iaik.smime.AuthEncryptedContent ec,
iaik.cms.KeyIdentifier recipientKeyId)
Dumps the given authenticated encrypted content.
|
void |
dumpEncrypted(iaik.smime.EncryptedContent ec,
iaik.cms.KeyIdentifier recipientKeyId)
Dumps the given encrypted content.
|
void |
dumpEncrypted(iaik.smime.EncryptedContent ec,
iaik.cms.KeyIdentifier recipientKeyId,
java.security.PrivateKey recipientKey)
Dumps the given encrypted content for the recipient identified by the given recipient key id
using the given private recipient decryption key.
|
static void |
dumpEncryptedMessage(jakarta.mail.Message msg)
Dumps the given encrypted message and decrypts the content for
the several recipients.
|
void |
dumpEnvelope(jakarta.mail.Message m)
Prints the envelope of a message.
|
static void |
dumpMsg(jakarta.mail.Message msg)
Dumps the given message to System.out.
|
void |
dumpPKCS10(iaik.smime.PKCS10Content pkcs10)
Dumps the given PKCS#10 content.
|
void |
dumpReceiptContent(iaik.smime.ess.ReceiptContent rc)
Dumps the given signed receipt.
|
void |
dumpSigned(iaik.smime.SignedContent sc)
Dumps the given signed content.
|
iaik.x509.X509Certificate[] |
getSignerCerts()
Gets the certificates of the signer included in a signed message.
|
void |
setRecipientKey(java.security.PrivateKey recipientKey)
Sets the private recipient key to be used to decrypt an encrypted message.
|
public DumpMessage()
public static void dumpMsg(jakarta.mail.Message msg) throws java.lang.Exception
msg
- the message to be dumpedjava.lang.Exception
- if an error occurspublic static void dumpEncryptedMessage(jakarta.mail.Message msg) throws java.lang.Exception
msg
- the message to be dumpedjava.lang.Exception
- if an error occurspublic void setRecipientKey(java.security.PrivateKey recipientKey)
CMSKeyStore
used by the demos
is CMSKeyStore#getRecipientCert(KeyIdentifier) searched
for a recipient decryption key based on the recipient key identifier.recipientKey
- the private key of the recipientpublic iaik.x509.X509Certificate[] getSignerCerts()
null
otherwise.public void dump(java.lang.Object o) throws java.lang.Exception
o
- the object to be dumpedjava.lang.Exception
- if an error occurspublic void dumpEncrypted(iaik.smime.EncryptedContent ec, iaik.cms.KeyIdentifier recipientKeyId) throws java.lang.Exception
ec
- the EncryptedContent to be dumpedrecipientKeyId
- the id of the recipient key to be used for decrypting the contentjava.lang.Exception
- if an error occurspublic void dumpEncrypted(iaik.smime.EncryptedContent ec, iaik.cms.KeyIdentifier recipientKeyId, java.security.PrivateKey recipientKey) throws java.lang.Exception
ec
- the EncryptedContent to be dumpedrecipientKeyId
- the id of the recipient key to be used for decrypting the contentrecipientKey
- the private key of the recipientjava.lang.Exception
- if an error occurspublic void dumpAuthEncrypted(iaik.smime.AuthEncryptedContent ec, iaik.cms.KeyIdentifier recipientKeyId) throws java.lang.Exception
ec
- the AuthEncryptedContent to be dumpedrecipientKeyId
- the id of the recipient key to be used for decrypting the contentjava.lang.Exception
- if an error occurspublic void dumpSigned(iaik.smime.SignedContent sc) throws java.lang.Exception
sc
- the SignedContent to be dumpedjava.lang.Exception
- if an error occurspublic void dumpPKCS10(iaik.smime.PKCS10Content pkcs10) throws java.lang.Exception
pkcs10
- the PKCS10Content to be dumpedjava.lang.Exception
- if an error occurspublic void dumpReceiptContent(iaik.smime.ess.ReceiptContent rc) throws java.lang.Exception
rc
- the signed receipt to be dumpedjava.lang.Exception
- if an error occurspublic void dumpEnvelope(jakarta.mail.Message m) throws jakarta.mail.MessagingException
m
- the messagejakarta.mail.MessagingException
- if an error occurs