|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mail.node.crypt.CryptEngine mail.node.crypt.MyCryptEngine
public class MyCryptEngine
To get this running, download the
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0
from http://java.sun.com/javase/downloads/index_jdk5.jsp
You will also need org.apache-xml.security-1.4.1,
but you will not need bouncy castle, because the java6 comes with jce already.
Field Summary | |
---|---|
(package private) EncSupply |
enc
|
(package private) java.security.KeyStore |
k
|
(package private) java.security.PublicKey |
pubkey
|
Constructor Summary | |
---|---|
MyCryptEngine(EncSupply enc)
|
Method Summary | |
---|---|
boolean |
checkSignature(org.w3c.dom.Element data)
decodes the signature with the public key and then checks it |
void |
decrypt(org.w3c.dom.Element data)
decrypt data with the private key The document that contains the Element will be modified! |
void |
encrypt(org.w3c.dom.Element data)
encrypt data with the public key The document that contains the Element will be modified! |
private static javax.crypto.SecretKey |
generateDataEncryptionKey()
Get a key to be used for encrypting the element. |
byte[] |
getPublicKey()
|
java.lang.String |
getPublicKeyString()
|
private static void |
print(org.w3c.dom.Document d)
|
void |
sign(org.w3c.dom.Element data)
sign data with the private key The document that contains the Element will be modified! |
Methods inherited from class mail.node.crypt.CryptEngine |
---|
fromHex, getID, getID, toHex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.security.KeyStore k
java.security.PublicKey pubkey
EncSupply enc
Constructor Detail |
---|
public MyCryptEngine(EncSupply enc) throws EncSupplyException
EncSupplyException
Method Detail |
---|
private static javax.crypto.SecretKey generateDataEncryptionKey() throws java.lang.Exception
java.lang.Exception
public void decrypt(org.w3c.dom.Element data) throws EncryptionException
CryptEngine
decrypt
in class CryptEngine
data
- to be decrypted
EncryptionException
public void encrypt(org.w3c.dom.Element data) throws EncryptionException
CryptEngine
encrypt
in class CryptEngine
data
- to be encrypted
EncryptionException
public byte[] getPublicKey()
getPublicKey
in class CryptEngine
public java.lang.String getPublicKeyString()
getPublicKeyString
in class CryptEngine
public boolean checkSignature(org.w3c.dom.Element data) throws EncryptionException
CryptEngine
checkSignature
in class CryptEngine
data
- to check
EncryptionException
public void sign(org.w3c.dom.Element data) throws EncryptionException
CryptEngine
sign
in class CryptEngine
data
- to be signed
EncryptionException
private static void print(org.w3c.dom.Document d) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |