Class Encryptor

java.lang.Object
org.docx4j.org.apache.poi.poifs.crypt.Encryptor
Direct Known Subclasses:
AgileEncryptor, BinaryRC4Encryptor, CryptoAPIEncryptor, StandardEncryptor

public abstract class Encryptor
extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected static java.lang.String DEFAULT_POIFS_ENTRY  
  • Constructor Summary

    Constructors
    Constructor Description
    Encryptor()  
  • Method Summary

    Modifier and Type Method Description
    abstract void confirmPassword​(java.lang.String password)  
    abstract void confirmPassword​(java.lang.String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)  
    abstract java.io.OutputStream getDataStream​(DirectoryNode dir)
    Return a output stream for encrypted data.
    java.io.OutputStream getDataStream​(NPOIFSFileSystem fs)  
    java.io.OutputStream getDataStream​(OPOIFSFileSystem fs)  
    java.io.OutputStream getDataStream​(POIFSFileSystem fs)  
    static Encryptor getInstance​(EncryptionInfo info)  
    javax.crypto.SecretKey getSecretKey()  
    protected void setSecretKey​(javax.crypto.SecretKey secretKey)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_POIFS_ENTRY

      protected static final java.lang.String DEFAULT_POIFS_ENTRY
      See Also:
      Constant Field Values
  • Constructor Details

    • Encryptor

      public Encryptor()
  • Method Details

    • getDataStream

      public abstract java.io.OutputStream getDataStream​(DirectoryNode dir) throws java.io.IOException, java.security.GeneralSecurityException
      Return a output stream for encrypted data.
      Parameters:
      dir - the node to write to
      Returns:
      encrypted stream
      Throws:
      java.io.IOException
      java.security.GeneralSecurityException
    • confirmPassword

      public abstract void confirmPassword​(java.lang.String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)
    • confirmPassword

      public abstract void confirmPassword​(java.lang.String password)
    • getInstance

      public static Encryptor getInstance​(EncryptionInfo info)
    • getDataStream

      public java.io.OutputStream getDataStream​(NPOIFSFileSystem fs) throws java.io.IOException, java.security.GeneralSecurityException
      Throws:
      java.io.IOException
      java.security.GeneralSecurityException
    • getDataStream

      public java.io.OutputStream getDataStream​(OPOIFSFileSystem fs) throws java.io.IOException, java.security.GeneralSecurityException
      Throws:
      java.io.IOException
      java.security.GeneralSecurityException
    • getDataStream

      public java.io.OutputStream getDataStream​(POIFSFileSystem fs) throws java.io.IOException, java.security.GeneralSecurityException
      Throws:
      java.io.IOException
      java.security.GeneralSecurityException
    • getSecretKey

      public javax.crypto.SecretKey getSecretKey()
    • setSecretKey

      protected void setSecretKey​(javax.crypto.SecretKey secretKey)