Package org.apache.poi.poifs.crypt

Examples of org.apache.poi.poifs.crypt.CipherAlgorithm


        setCspName(null);
        setBlockSize(keyData.getBlockSize());

        int keyBits = (int)keyData.getKeyBits();
       
        CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits);
        setCipherAlgorithm(ca);
        setCipherProvider(ca.provider);

        switch (keyData.getCipherChaining().intValue()) {
        case STCipherChaining.INT_CHAINING_MODE_CBC:
View Full Code Here


            throw new EncryptedDocumentException("Unable to parse keyData", e);
        }
       
        int keyBits = (int)keyData.getKeyBits();
       
        CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits);
        setCipherAlgorithm(ca);

        int hashSize = keyData.getHashSize();

        HashAlgorithm ha = HashAlgorithm.fromEcmaId(keyData.getHashAlgorithm().toString());
View Full Code Here

    Biff8RC4Key(byte[] keyDigest) {
        if (keyDigest.length != KEY_DIGEST_LENGTH) {
            throw new IllegalArgumentException("Expected 5 byte key digest, but got " + HexDump.toHex(keyDigest));
        }

        CipherAlgorithm ca = CipherAlgorithm.rc4;
        _secretKey = new SecretKeySpec(keyDigest, ca.jceId);
    }
View Full Code Here

        return Arrays.equals(verifierHashPrime, finalVerifierResult);
    }
   
    Cipher getCipher() {
        CipherAlgorithm ca = CipherAlgorithm.rc4;
        Cipher rc4 = CryptoFunctions.getCipher(_secretKey, ca, null, null, Cipher.ENCRYPT_MODE);
        return rc4;
    }
View Full Code Here

        setCspName(null);
        setBlockSize(keyData.getBlockSize());

        int keyBits = (int)keyData.getKeyBits();
       
        CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits);
        setCipherAlgorithm(ca);
        setCipherProvider(ca.provider);

        switch (keyData.getCipherChaining().intValue()) {
        case STCipherChaining.INT_CHAINING_MODE_CBC:
View Full Code Here

            throw new EncryptedDocumentException("Unable to parse keyData", e);
        }
       
        int keyBits = (int)keyData.getKeyBits();
       
        CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits);
        setCipherAlgorithm(ca);

        int hashSize = keyData.getHashSize();

        HashAlgorithm ha = HashAlgorithm.fromEcmaId(keyData.getHashAlgorithm().toString());
View Full Code Here

     */
    public boolean verifyPassword(String password) throws GeneralSecurityException {
        AgileEncryptionVerifier ver = builder.getVerifier();
        AgileEncryptionHeader header = builder.getHeader();
        HashAlgorithm hashAlgo = header.getHashAlgorithmEx();
        CipherAlgorithm cipherAlgo = header.getCipherAlgorithm();
        int blockSize = header.getBlockSize();
        int keySize = header.getKeySize()/8;

        byte[] pwHash = hashPassword(password, ver.getHashAlgorithm(), ver.getSalt(), ver.getSpinCount());

View Full Code Here

     */
    public boolean verifyPassword(KeyPair keyPair, X509Certificate x509) throws GeneralSecurityException {
        AgileEncryptionVerifier ver = builder.getVerifier();
        AgileEncryptionHeader header = builder.getHeader();
        HashAlgorithm hashAlgo = header.getHashAlgorithmEx();
        CipherAlgorithm cipherAlgo = header.getCipherAlgorithm();
        int blockSize = header.getBlockSize();
       
        AgileCertificateEntry ace = null;
        for (AgileCertificateEntry aceEntry : ver.getCertificates()) {
            if (x509.equals(aceEntry.x509)) {
View Full Code Here

TOP

Related Classes of org.apache.poi.poifs.crypt.CipherAlgorithm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.