|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.suberic.crypto.EncryptionUtils
net.suberic.crypto.PGPEncryptionUtils
Utilities for encrypting/decrypting messages. This class just handles the parsing of the OpenPGP message itself. Actual PGP encoding/decoding is left to the PGPProviderImpl class itself.
Field Summary |
Fields inherited from class net.suberic.crypto.EncryptionUtils |
ATTACHED_KEYS, ENCRYPTED, NOT_ENCRYPTED, SIGNED |
Constructor Summary | |
PGPEncryptionUtils()
|
Method Summary | |
boolean |
checkSignature(java.io.InputStream rawStream,
byte[] signature,
java.security.Key key)
Checks a signature against a section of text. |
boolean |
checkSignature(javax.mail.internet.MimeMessage mm,
java.security.Key key)
Checks the signature on a MimeMessage. |
boolean |
checkSignature(javax.mail.internet.MimeMultipart mMulti,
java.security.Key key)
Checks the signature on a BodyPart. |
boolean |
checkSignature(javax.mail.internet.MimePart part,
java.security.Key key)
Checks the signature on a MimePart. |
protected javax.mail.internet.MimeBodyPart |
createEncryptedPart(java.io.InputStream stream,
java.security.Key key)
Makes an encrypted BodyPart from the content in the given InputStream. |
EncryptionKeyManager |
createKeyManager()
Returns a KeyStore provider. |
EncryptionKeyManager |
createKeyManager(java.io.InputStream inputStream,
char[] password)
Returns a KeyStore provider. |
javax.mail.internet.MimeBodyPart |
createPublicKeyPart(java.security.Key[] keys)
Packages up the public keys in a form to be sent as a public key message. |
byte[] |
decrypt(java.io.InputStream encryptedStream,
java.security.Key key)
Decrypts a section of text using an java.security.Key. |
javax.mail.internet.MimeBodyPart |
decryptBodyPart(javax.mail.internet.MimeBodyPart part,
java.security.Key key)
Decrypts a MimeBodyPart. |
javax.mail.internet.MimeMessage |
decryptMessage(javax.mail.Session s,
javax.mail.internet.MimeMessage msg,
java.security.Key key)
Decrypts a Message. |
javax.mail.internet.MimeBodyPart |
decryptMultipart(javax.mail.internet.MimeMultipart mpart,
java.security.Key key)
Decrypts a Multipart. |
byte[] |
encrypt(java.io.InputStream rawStream,
java.security.Key key)
Encrypts a section of text using an java.security.Key. |
javax.mail.internet.MimeMessage |
encryptMessage(javax.mail.Session s,
javax.mail.internet.MimeMessage msg,
java.security.Key key)
Encrypts a Message. |
javax.mail.internet.MimeBodyPart |
encryptPart(javax.mail.internet.MimeBodyPart part,
java.security.Key key)
Encrypts a MimeBodyPart; |
java.security.Key[] |
extractKeys(java.io.InputStream rawStream)
Extracts public key information. |
java.security.Key[] |
extractKeys(javax.mail.internet.MimeBodyPart mbp)
Extracts public key information. |
java.security.Key[] |
extractKeys(javax.mail.internet.MimeMessage m)
Extracts public key information. |
int |
getEncryptionStatus(javax.mail.internet.MimePart m)
Returns the encryption status of this MimeMessage: ENCRYPTED, SIGNED, or NOT_ENCRYPTED. |
PGPProviderImpl |
getPGPProviderImpl()
Returns the PGPProviderImpl. |
javax.mail.internet.MimeBodyPart |
getSignedContent(javax.mail.internet.MimePart mp)
Returns the signed body part. |
java.lang.String |
getType()
Returns the encryption type that these utils are implementing (PGP or SMIME). |
byte[] |
packageKeys(java.security.Key[] keys)
Packages up the public keys in a form to be sent as a public key message. |
void |
setPGPProviderImpl(PGPProviderImpl newPgpImpl)
Sets the PGPProviderImpl. |
byte[] |
sign(java.io.InputStream rawStream,
java.security.Key key)
Signs a section of text. |
javax.mail.internet.MimeBodyPart |
signBodyPart(javax.mail.internet.MimeBodyPart mbp,
java.security.Key key)
Signs a MimeBodyPart. |
javax.mail.internet.MimeMessage |
signMessage(javax.mail.Session s,
javax.mail.internet.MimeMessage msg,
java.security.Key key)
Signs a Message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PGPEncryptionUtils()
Method Detail |
public PGPProviderImpl getPGPProviderImpl()
public void setPGPProviderImpl(PGPProviderImpl newPgpImpl)
public byte[] decrypt(java.io.InputStream encryptedStream, java.security.Key key) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.GeneralSecurityException
public byte[] encrypt(java.io.InputStream rawStream, java.security.Key key) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.GeneralSecurityException
public byte[] sign(java.io.InputStream rawStream, java.security.Key key) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.GeneralSecurityException
public boolean checkSignature(java.io.InputStream rawStream, byte[] signature, java.security.Key key) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.GeneralSecurityException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.GeneralSecurityException
public java.security.Key[] extractKeys(java.io.InputStream rawStream) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public byte[] packageKeys(java.security.Key[] keys) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public javax.mail.internet.MimeMessage encryptMessage(javax.mail.Session s, javax.mail.internet.MimeMessage msg, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
encryptMessage
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeMessage decryptMessage(javax.mail.Session s, javax.mail.internet.MimeMessage msg, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
decryptMessage
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart encryptPart(javax.mail.internet.MimeBodyPart part, java.security.Key key) throws javax.mail.MessagingException, java.security.GeneralSecurityException, java.io.IOException
encryptPart
in class EncryptionUtils
javax.mail.MessagingException
java.security.GeneralSecurityException
java.io.IOException
protected javax.mail.internet.MimeBodyPart createEncryptedPart(java.io.InputStream stream, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart decryptBodyPart(javax.mail.internet.MimeBodyPart part, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
decryptBodyPart
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart decryptMultipart(javax.mail.internet.MimeMultipart mpart, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
decryptMultipart
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart signBodyPart(javax.mail.internet.MimeBodyPart mbp, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
signBodyPart
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public boolean checkSignature(javax.mail.internet.MimeMessage mm, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
checkSignature
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeMessage signMessage(javax.mail.Session s, javax.mail.internet.MimeMessage msg, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
signMessage
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public boolean checkSignature(javax.mail.internet.MimePart part, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
checkSignature
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public boolean checkSignature(javax.mail.internet.MimeMultipart mMulti, java.security.Key key) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
checkSignature
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart getSignedContent(javax.mail.internet.MimePart mp) throws javax.mail.MessagingException, java.io.IOException
getSignedContent
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
public java.security.Key[] extractKeys(javax.mail.internet.MimeMessage m) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
extractKeys
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public java.security.Key[] extractKeys(javax.mail.internet.MimeBodyPart mbp) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
extractKeys
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public javax.mail.internet.MimeBodyPart createPublicKeyPart(java.security.Key[] keys) throws javax.mail.MessagingException, java.io.IOException, java.security.GeneralSecurityException
createPublicKeyPart
in class EncryptionUtils
javax.mail.MessagingException
java.io.IOException
java.security.GeneralSecurityException
public EncryptionKeyManager createKeyManager()
createKeyManager
in class EncryptionUtils
public EncryptionKeyManager createKeyManager(java.io.InputStream inputStream, char[] password) throws java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.cert.CertificateException
java.io.IOException
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.cert.CertificateException
public int getEncryptionStatus(javax.mail.internet.MimePart m) throws javax.mail.MessagingException
getEncryptionStatus
in class EncryptionUtils
javax.mail.MessagingException
public java.lang.String getType()
getType
in class EncryptionUtils
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |