|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.poifs.crypt.CryptoFunctions
public class CryptoFunctions
Helper functions used for standard and agile encryption
Constructor Summary | |
---|---|
CryptoFunctions()
|
Method Summary | |
---|---|
static byte[] |
generateIv(HashAlgorithm hashAlgorithm,
byte[] salt,
byte[] blockKey,
int blockSize)
2.3.4.12 Initialization Vector Generation (Agile Encryption) Initialization vectors are used in all cases for agile encryption. |
static byte[] |
generateKey(byte[] passwordHash,
HashAlgorithm hashAlgorithm,
byte[] blockKey,
int keySize)
2.3.4.11 Encryption Key Generation (Agile Encryption) ... |
static byte[] |
getBlock0(byte[] hash,
int size)
|
static byte[] |
getBlock36(byte[] hash,
int size)
|
static javax.crypto.Cipher |
getCipher(javax.crypto.SecretKey key,
CipherAlgorithm cipherAlgorithm,
ChainingMode chain,
byte[] vec,
int cipherMode)
|
static javax.crypto.Cipher |
getCipher(javax.crypto.SecretKey key,
CipherAlgorithm cipherAlgorithm,
ChainingMode chain,
byte[] vec,
int cipherMode,
java.lang.String padding)
|
static javax.crypto.Mac |
getMac(HashAlgorithm hashAlgorithm)
|
static java.security.MessageDigest |
getMessageDigest(HashAlgorithm hashAlgorithm)
|
static byte[] |
getUtf16LeString(java.lang.String str)
|
static byte[] |
hashPassword(java.lang.String password,
HashAlgorithm hashAlgorithm,
byte[] salt,
int spinCount)
2.3.4.7 ECMA-376 Document Encryption Key Generation (Standard Encryption) 2.3.4.11 Encryption Key Generation (Agile Encryption) The encryption key for ECMA-376 document encryption [ECMA-376] using agile encryption MUST be generated by using the following method, which is derived from PKCS #5: Password-Based Cryptography Version 2.0 [RFC2898]. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptoFunctions()
Method Detail |
---|
public static byte[] hashPassword(java.lang.String password, HashAlgorithm hashAlgorithm, byte[] salt, int spinCount)
generateKey(byte[],HashAlgorithm,byte[],int)
password
- hashAlgorithm
- salt
- spinCount
-
public static byte[] generateIv(HashAlgorithm hashAlgorithm, byte[] salt, byte[] blockKey, int blockSize)
public static byte[] generateKey(byte[] passwordHash, HashAlgorithm hashAlgorithm, byte[] blockKey, int keySize)
passwordHash
- hashAlgorithm
- blockKey
- keySize
-
public static javax.crypto.Cipher getCipher(javax.crypto.SecretKey key, CipherAlgorithm cipherAlgorithm, ChainingMode chain, byte[] vec, int cipherMode)
public static javax.crypto.Cipher getCipher(javax.crypto.SecretKey key, CipherAlgorithm cipherAlgorithm, ChainingMode chain, byte[] vec, int cipherMode, java.lang.String padding)
key
- chain
- vec
- cipherMode
- Cipher.DECRYPT_MODE or Cipher.ENCRYPT_MODE
java.security.GeneralSecurityException
public static byte[] getBlock36(byte[] hash, int size)
public static byte[] getBlock0(byte[] hash, int size)
public static byte[] getUtf16LeString(java.lang.String str)
public static java.security.MessageDigest getMessageDigest(HashAlgorithm hashAlgorithm)
public static javax.crypto.Mac getMac(HashAlgorithm hashAlgorithm)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |