@NotThreadSafe public final class PPK extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PPK.Builder |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] bytes) |
String |
decrypt(byte[] bytes,
Charset charset) |
void |
decrypt(InputStream is,
OutputStream os) |
String |
decryptBase64(String base64) |
byte[] |
decryptRsa(byte[] bytes) |
String |
decryptRsa(byte[] bytes,
Charset charset) |
String |
decryptRsaBase64(String base64) |
byte[] |
encrypt(byte[] bytes) |
byte[] |
encrypt(InputStream is) |
void |
encrypt(InputStream is,
OutputStream os) |
byte[] |
encrypt(String string,
Charset charset) |
String |
encryptAsBase64(String string) |
byte[] |
encryptRsa(byte[] bytes) |
byte[] |
encryptRsa(String string,
Charset charset) |
String |
encryptRsaAsBase64(String string) |
static PPK.Builder |
privateKey(byte[] bytes)
Returns a PPK builder having read the private key from the given byte
array.
|
static PPK.Builder |
privateKey(Class<?> cls,
String resource)
Returns a builder having loaded the private key from the classpath
relative to the classloader used by
cls . |
static PPK.Builder |
privateKey(File file)
Returns a PPK builder having read the private key from the given file.
|
static PPK.Builder |
privateKey(InputStream is)
Returns a PPK builder having read the private key from the given
InputStream.
|
static PPK.Builder |
privateKey(String resource)
Returns a PPK builder having set the private key location on the
classpath relative to the classloader used by
PPK . |
static PPK.Builder |
publicKey(byte[] bytes) |
static PPK.Builder |
publicKey(Class<?> cls,
String resource)
Returns a builder having loaded the public key from the classpath
relative to the classloader used by
cls . |
static PPK.Builder |
publicKey(File file) |
static PPK.Builder |
publicKey(InputStream is) |
static PPK.Builder |
publicKey(String resource)
Returns a builder having loaded the public key from the classpath
relative to the classloader used by
PPK . |
public static final PPK.Builder privateKey(Class<?> cls, String resource)
cls
.cls
- the class whose classloader is used to load the resourceresource
- the resource pathpublic static final PPK.Builder privateKey(String resource)
PPK
.resource
- the resource pathpublic static final PPK.Builder privateKey(InputStream is)
is
- private key input streampublic static final PPK.Builder privateKey(File file)
file
- that contains the private keypublic static final PPK.Builder privateKey(byte[] bytes)
bytes
- of the private keypublic static final PPK.Builder publicKey(Class<?> cls, String resource)
cls
.cls
- the class whose classloader is used to load the resourceresource
- the resource pathpublic static final PPK.Builder publicKey(String resource)
PPK
.resource
- the resource pathpublic static final PPK.Builder publicKey(File file)
public static final PPK.Builder publicKey(InputStream is)
public static final PPK.Builder publicKey(byte[] bytes)
public void encrypt(InputStream is, OutputStream os)
public byte[] encrypt(InputStream is)
public byte[] encrypt(byte[] bytes)
public void decrypt(InputStream is, OutputStream os)
public byte[] decrypt(byte[] bytes)
public byte[] encryptRsa(byte[] bytes)
public byte[] decryptRsa(byte[] bytes)
Copyright © 2015. All rights reserved.