public class PasswdEncryption
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
MAX_ENCRYPTION_LENGHT |
| Constructor | Description |
|---|---|
PasswdEncryption() |
| Modifier and Type | Method | Description |
|---|---|---|
static byte[] |
decrypt(byte[] text,
java.security.PrivateKey key) |
Decrypt a sequence of bytes.
|
static java.lang.String |
decrypt(java.lang.String text,
java.security.PrivateKey key) |
Decrypt a text.
|
static byte[] |
encrypt(byte[] text) |
Encrypt a sequence of bytes a default public key.
|
static byte[] |
encrypt(byte[] text,
java.security.PublicKey key) |
Encrypt a sequence of bytes.
|
static java.lang.String |
encrypt(java.lang.String text) |
Encrypt a text with a default public key.
|
static java.lang.String |
encrypt(java.lang.String text,
java.security.PublicKey key) |
Encrypt a text.
|
public static final int MAX_ENCRYPTION_LENGHT
public static java.lang.String encrypt(java.lang.String text)
throws java.io.IOException,
java.security.GeneralSecurityException
text - text to encryptjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occurspublic static byte[] encrypt(byte[] text)
throws java.io.IOException,
java.security.GeneralSecurityException
text - byte array to encryptjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occurspublic static byte[] encrypt(byte[] text,
java.security.PublicKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
text - byte array to encryptkey - the public key used for the encryptionjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occurspublic static byte[] decrypt(byte[] text,
java.security.PrivateKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
text - byte array to decryptkey - the private key used for the decryptionjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occurspublic static java.lang.String encrypt(java.lang.String text,
java.security.PublicKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
text - text to encryptkey - the public key used for the encryptionjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occurspublic static java.lang.String decrypt(java.lang.String text,
java.security.PrivateKey key)
throws java.io.IOException,
java.security.GeneralSecurityException
text - text to decryptkey - the private key used for the decryptionjava.io.IOException - when I/O error occursjava.security.GeneralSecurityException - when transformation error occursBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.