com.healthmarketscience.jackcess.impl
Class OfficeCryptCodecHandler

java.lang.Object
  extended by com.healthmarketscience.jackcess.impl.BaseCryptCodecHandler
      extended by com.healthmarketscience.jackcess.impl.OfficeCryptCodecHandler
All Implemented Interfaces:
com.healthmarketscience.jackcess.impl.CodecHandler
Direct Known Subclasses:
BlockCipherProvider, StreamCipherProvider

public abstract class OfficeCryptCodecHandler
extends BaseCryptCodecHandler

CryptCodecHandler for the Office Document Cryptography standard.

Author:
James Ahlborn

Nested Class Summary
protected static class OfficeCryptCodecHandler.Phase
           
 
Field Summary
 
Fields inherited from class com.healthmarketscience.jackcess.impl.BaseCryptCodecHandler
CIPHER_DECRYPT_MODE, CIPHER_ENCRYPT_MODE
 
Constructor Summary
protected OfficeCryptCodecHandler(com.healthmarketscience.jackcess.impl.PageChannel channel, byte[] encodingKey)
           
 
Method Summary
protected static int bits2bytes(int bits)
           
static com.healthmarketscience.jackcess.impl.CodecHandler create(PasswordCallback callback, com.healthmarketscience.jackcess.impl.PageChannel channel, Charset charset)
           
 void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)
           
protected abstract  void decodePageImpl(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)
           
 ByteBuffer encodePage(ByteBuffer buffer, int pageNumber, int pageOffset)
           
protected abstract  ByteBuffer encodePageImpl(ByteBuffer buffer, int pageNumber, int pageOffset)
           
protected  org.bouncycastle.crypto.Digest getDigest()
           
protected  OfficeCryptCodecHandler.Phase getPhase()
           
protected  org.bouncycastle.crypto.Digest initCryptDigest()
           
protected  org.bouncycastle.crypto.Digest initDigest()
           
protected  org.bouncycastle.crypto.Digest initPwdDigest()
           
protected  byte[] int2bytes(int val)
           
protected  byte[] iterateHash(byte[] baseHash, int iterations)
           
protected  void reset()
           
protected abstract  boolean verifyPassword(byte[] pwdBytes)
           
 
Methods inherited from class com.healthmarketscience.jackcess.impl.BaseCryptCodecHandler
applyPageNumber, blockDecrypt, blockDecryptBytes, blockEncrypt, computeCipherParams, decryptBytes, decryptBytes, decryptInit, decryptInit, encryptInit, encryptInit, fill, fixToLength, fixToLength, getBlockCipher, getCipherParams, getEncodingKey, getEncodingKey, getStreamCipher, getTempBuffer, hash, hash, hash, hash, isBlankKey, processBytesFully, readHeaderPage, streamDecrypt, streamEncrypt, toString, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.healthmarketscience.jackcess.impl.CodecHandler
canDecodeInline, canEncodePartialPage
 

Constructor Detail

OfficeCryptCodecHandler

protected OfficeCryptCodecHandler(com.healthmarketscience.jackcess.impl.PageChannel channel,
                                  byte[] encodingKey)
Method Detail

create

public static com.healthmarketscience.jackcess.impl.CodecHandler create(PasswordCallback callback,
                                                                        com.healthmarketscience.jackcess.impl.PageChannel channel,
                                                                        Charset charset)
                                                                 throws IOException
Throws:
IOException

getPhase

protected OfficeCryptCodecHandler.Phase getPhase()

getDigest

protected org.bouncycastle.crypto.Digest getDigest()

initDigest

protected org.bouncycastle.crypto.Digest initDigest()

initPwdDigest

protected org.bouncycastle.crypto.Digest initPwdDigest()

initCryptDigest

protected org.bouncycastle.crypto.Digest initCryptDigest()

int2bytes

protected final byte[] int2bytes(int val)

reset

protected void reset()

decodePage

public void decodePage(ByteBuffer inPage,
                       ByteBuffer outPage,
                       int pageNumber)
                throws IOException
Throws:
IOException

encodePage

public ByteBuffer encodePage(ByteBuffer buffer,
                             int pageNumber,
                             int pageOffset)
                      throws IOException
Throws:
IOException

iterateHash

protected byte[] iterateHash(byte[] baseHash,
                             int iterations)

bits2bytes

protected static int bits2bytes(int bits)

decodePageImpl

protected abstract void decodePageImpl(ByteBuffer inPage,
                                       ByteBuffer outPage,
                                       int pageNumber)
                                throws IOException
Throws:
IOException

encodePageImpl

protected abstract ByteBuffer encodePageImpl(ByteBuffer buffer,
                                             int pageNumber,
                                             int pageOffset)
                                      throws IOException
Throws:
IOException

verifyPassword

protected abstract boolean verifyPassword(byte[] pwdBytes)


Copyright © 2010-2017 Health Market Science. All Rights Reserved.