|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAMETAS.cipher.Cipher
AMETAS.cipher.AsymmetricCipher
AMETAS.cipher.RSA
Der Verschlüsselungsalgorithmus RSA. Dieser Algorithmus realisiert ein asymmetrisches Verschlüsselungsverfahren mit einem öffentlichen und einem privaten Schlüssel.
| Field Summary |
| Fields inherited from class AMETAS.cipher.Cipher |
CBC, ECB, m_abCBCBuffer, m_bDebug |
| Constructor Summary | |
RSA()
Konstruktor. |
|
| Method Summary | |
int |
blocksize()
Liefert die Blockgröße (in Bytes) von RSA. |
int |
blocksizeCipher()
Liefert die Blockgrösse (in Bytes) von RSA. |
java.math.BigInteger |
decrypt(java.math.BigInteger biCipher)
Entschlüsselt einen BigInteger. |
void |
decryptBlock(byte[] abyBlockCipher,
int nOffsetCipher,
byte[] abyBlockPlain,
int nOffsetPlain)
Entschlüsselt das Feld abyBlockCipher ab der Position nOffsetCipher für blocksizeCipher() viele Bytes und kopiert die entschlüsselten
Bytes in das Feld abyBlockPlain an die Stelle nOffsetPlain.
|
java.math.BigInteger |
encrypt(java.math.BigInteger biPlain)
Verschlüsselt einen BigInteger. |
void |
encryptBlock(byte[] abyBlockPlain,
int nOffsetPlain,
byte[] abyBlockCipher,
int nOffsetCipher)
Verschlüsselt das Feld abyBlockPlain ab der Position nOffsetPlain für blocksize() viele Bytes und kopiert die verschlüsselten
Bytes in das Feld abyBlockCipher an die Stelle nOffsetCipher.
|
void |
setKey(java.security.Key rsaPublicKey)
Setzt den öffentlichen Schlüssel. |
void |
setKeys(java.security.PrivateKey rsaPrivateKey,
java.security.PublicKey rsaPublicKey)
Setzt die Schlüssel. |
void |
setPrivateKey(java.security.PrivateKey rsaPrivateKey)
Setzt den privaten Schlüssel. |
void |
setPrivateKey(java.security.PublicKey rsaPublicKey)
Setzt den privaten Schlüssel. |
void |
setPublicKey(java.security.PrivateKey rsaPrivateKey)
Setzt den öffentlichen Schlüssel. |
void |
setPublicKey(java.security.PublicKey rsaPublicKey)
Setzen des öffentlichen Schlüssels. |
java.lang.String |
toString()
Informationen über Algorithmus und Schlüssel. |
| Methods inherited from class AMETAS.cipher.AsymmetricCipher |
getInstance, getInstance |
| Methods inherited from class AMETAS.cipher.Cipher |
decrypt, decrypt, decrypt, decrypt, doBlockAdaptation, encrypt, encrypt, encrypt, encrypt, getAlgorithm, getCipherInstance, getCipherInstance, getMode, getNumberOfBytes, setDebug, setMode, undoAdaptation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RSA()
| Method Detail |
public void setKeys(java.security.PrivateKey rsaPrivateKey,
java.security.PublicKey rsaPublicKey)
throws java.security.InvalidKeyException
setKeys in class AsymmetricCipherrsaPrivateKey - Privater Schlüssel vom Typ RSAPrivateKey.rsaPublicKey - Öffentlicher Schlüssel vom Typ RSAPublicKey.
java.security.InvalidKeyException - falls die Schlüssel vom falschen Typ sind oder die
die Bitlänge der Schlüssels nicht durch 8 teilbar ist.
public void setKey(java.security.Key rsaPublicKey)
throws java.security.InvalidKeyException
setKey in class CipherrsaPublicKey - Öffentlicher Schlüssel vom Typ RSAPublicKey.
java.security.InvalidKeyException - falls der Schlüssel kein RSAPublicKey ist
oder die Bitlänge nicht durch 8 teilbar ist.
public void setPublicKey(java.security.PublicKey rsaPublicKey)
throws java.security.InvalidKeyException
setPublicKey in class AsymmetricCipherrsaPublicKey - Öffentlicher Schlüssel vom Typ RSAPublicKey.
java.security.InvalidKeyException - falls der Schlüssel kein RSAPublicKey ist
oder die Bitlänge nicht durch 8 teilbar ist.
public void setPublicKey(java.security.PrivateKey rsaPrivateKey)
throws java.security.InvalidKeyException
rsaPrivateKey - Schlüssel vom Typ RSAPrivateKey zum Verschlüsseln.
java.security.InvalidKeyException - falls der Schlüssel kein RSAPrivateKey ist
oder die Bitlänge nicht durch 8 teilbar ist.
public void setPrivateKey(java.security.PublicKey rsaPublicKey)
throws java.security.InvalidKeyException
rsaPublicKey - Schlüssel vom Typ RSAPublicKey zum Verschlüsseln.
java.security.InvalidKeyException - falls die Schlüssel kein RSAPublicKey ist
oder die Bitlänge nicht durch 8 teilbar ist.
public void setPrivateKey(java.security.PrivateKey rsaPrivateKey)
throws java.security.InvalidKeyException
setPrivateKey in class AsymmetricCipherrsaPrivateKey - Privater Schlüssel vom Typ RSAPrivateKey.
java.security.InvalidKeyException - wird geworfen, falls der Schlüssel kein RSAPrivateKey ist.public java.lang.String toString()
public java.math.BigInteger encrypt(java.math.BigInteger biPlain)
throws CipherException
encrypt in class AsymmetricCipherbiPlain - Unverschlüsselte Wert.
CipherException - wenn der Schlüssel zur Verschlüsselung fehlt oder die
Bitlänge falsch ist.
public java.math.BigInteger decrypt(java.math.BigInteger biCipher)
throws CipherException
decrypt in class AsymmetricCipherbiCipher - Verschlüsselter Wert.
CipherException - wenn der Schlüssel zur Entschlüsselung fehlt oder die
Bitlänge falsch ist.public int blocksize()
blocksize in class Cipherpublic int blocksizeCipher()
blocksizeCipher in class Cipher
public void encryptBlock(byte[] abyBlockPlain,
int nOffsetPlain,
byte[] abyBlockCipher,
int nOffsetCipher)
throws CipherException
blocksize() viele Bytes und kopiert die verschlüsselten
Bytes in das Feld abyBlockCipher an die Stelle nOffsetCipher.
Achtung: Der Platz, der in dem CipherArray für die Daten gebraucht wird
beträgt blocksizeCipher().
encryptBlock in class CipherabyBlockPlain - Zu verschlüsselndes Bytefeld.nOffsetPlain - Position, ab der die Verschlüsselung beginnen soll.abyBlockCipher - Feld, in das der verschlüsselte Block kopiert werden soll.nOffsetCipher - Position im Feld, wohin der verschlüsselte Block kopiert werden soll.
CipherException - wenn ein Verschlüsselungsproblem auftrat. Dies
kann beim z.B. beim Fehlen eines Schlüssels oder bei einem falschen Datenformat
geschehen.
public void decryptBlock(byte[] abyBlockCipher,
int nOffsetCipher,
byte[] abyBlockPlain,
int nOffsetPlain)
throws CipherException
blocksizeCipher() viele Bytes und kopiert die entschlüsselten
Bytes in das Feld abyBlockPlain an die Stelle nOffsetPlain.
Der Platz, der in dem Zielfeld für die Daten gebraucht wird,
beträgt blocksize().
decryptBlock in class CipherabyBlockCipher - Zu entschlüsselndes Bytefeld.nOffsetCipher - Position, ab der die Entschlüsselung beginnen soll.abyBlockPlain - Feld, in das der entschlüsselte Block kopiert werden soll.nOffsetPlain - Position im Feld, wohin der entschlüsselte Block kopiert werden soll.
CipherException - wenn ein Entschlüsselungsproblem auftrat. Dies
kann beim z.B. beim Fehlen eines Schlüssels oder bei einem falschen Datenformat
geschehen.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||