Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6349F10FE0 for ; Sat, 11 Jan 2014 17:48:39 +0000 (UTC) Received: (qmail 39298 invoked by uid 500); 11 Jan 2014 17:40:50 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 39138 invoked by uid 500); 11 Jan 2014 17:40:33 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 39062 invoked by uid 99); 11 Jan 2014 17:40:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jan 2014 17:40:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jan 2014 17:40:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 787EA2388A2C; Sat, 11 Jan 2014 17:39:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1557428 [3/12] - in /poi/site/publish/apidocs: ./ org/apache/poi/hwpf/model/ org/apache/poi/hwpf/model/class-use/ org/apache/poi/hwpf/model/types/ org/apache/poi/hwpf/model/types/class-use/ org/apache/poi/poifs/crypt/ org/apache/poi/poifs/... Date: Sat, 11 Jan 2014 17:39:49 -0000 To: commits@poi.apache.org From: nick@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140111173953.787EA2388A2C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CipherProvider.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CipherProvider.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CipherProvider.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CipherProvider.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,385 @@ + + + + +CipherProvider (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Enum CipherProvider

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<CipherProvider>
    • +
    • +
        +
      • org.apache.poi.poifs.crypt.CipherProvider
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<CipherProvider>
    +
    +
    +
    +
    public enum CipherProvider
    +extends java.lang.Enum<CipherProvider>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      aes 
      rc4 
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      intecmaId 
      java.lang.StringjceId 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      static CipherProviderfromEcmaId(int ecmaId) 
      static CipherProvidervalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static CipherProvider[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        jceId

        +
        public final java.lang.String jceId
        +
      • +
      + + + +
        +
      • +

        ecmaId

        +
        public final int ecmaId
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static CipherProvider[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (CipherProvider c : CipherProvider.values())
        +    System.out.println(c);
        +
        +
        Returns:
        an array containing the constants of this enum type, in +the order they are declared
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static CipherProvider valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        Parameters:
        name - the name of the enum constant to be returned.
        +
        Returns:
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
      • +
      + + + +
        +
      • +

        fromEcmaId

        +
        public static CipherProvider fromEcmaId(int ecmaId)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CryptoFunctions.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CryptoFunctions.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CryptoFunctions.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/CryptoFunctions.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,493 @@ + + + + +CryptoFunctions (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Class CryptoFunctions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.poi.poifs.crypt.CryptoFunctions
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class CryptoFunctions
    +extends java.lang.Object
    +
    Helper functions used for standard and agile encryption
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CryptoFunctions() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      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.CiphergetCipher(javax.crypto.SecretKey key, + CipherAlgorithm cipherAlgorithm, + ChainingMode chain, + byte[] vec, + int cipherMode) 
      static javax.crypto.CiphergetCipher(javax.crypto.SecretKey key, + CipherAlgorithm cipherAlgorithm, + ChainingMode chain, + byte[] vec, + int cipherMode, + java.lang.String padding) 
      static javax.crypto.MacgetMac(HashAlgorithm hashAlgorithm) 
      static java.security.MessageDigestgetMessageDigest(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

      + + + +
        +
      • +

        CryptoFunctions

        +
        public CryptoFunctions()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hashPassword

        +
        public 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]. + + Let H() be a hashing algorithm as determined by the PasswordKeyEncryptor.hashAlgorithm + element, H_n be the hash data of the n-th iteration, and a plus sign (+) represent concatenation. The + password MUST be provided as an array of Unicode characters. Limitations on the length of the + password and the characters used by the password are implementation-dependent. The initial + password hash is generated as follows: + + - H_0 = H(salt + password) + + The salt used MUST be generated randomly. The salt MUST be stored in the + PasswordKeyEncryptor.saltValue element contained within the \EncryptionInfo stream (1) as + specified in section 2.3.4.10. The hash is then iterated by using the following approach: + + - H_n = H(iterator + H_n-1) + + where iterator is an unsigned 32-bit value that is initially set to 0x00000000 and then incremented + monotonically on each iteration until PasswordKey.spinCount iterations have been performed. + The value of iterator on the last iteration MUST be one less than PasswordKey.spinCount. + + For POI, H_final will be calculated by generateKey(byte[],HashAlgorithm,byte[],int)
        +
        Parameters:
        password -
        hashAlgorithm -
        salt -
        spinCount -
        +
        Returns:
        the hashed password
        +
      • +
      + + + +
        +
      • +

        generateIv

        +
        public 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. An initialization vector MUST be + generated by using the following method, where H() is a hash function that MUST be the same as + specified in section 2.3.4.11 and a plus sign (+) represents concatenation: + 1. If a blockKey is provided, let IV be a hash of the KeySalt and the following value: + blockKey: IV = H(KeySalt + blockKey) + 2. If a blockKey is not provided, let IV be equal to the following value: + KeySalt:IV = KeySalt. + 3. If the number of bytes in the value of IV is less than the the value of the blockSize attribute + corresponding to the cipherAlgorithm attribute, pad the array of bytes by appending 0x36 until + the array is blockSize bytes. If the array of bytes is larger than blockSize bytes, truncate the + array to blockSize bytes.
        +
      • +
      + + + +
        +
      • +

        generateKey

        +
        public static byte[] generateKey(byte[] passwordHash,
        +                 HashAlgorithm hashAlgorithm,
        +                 byte[] blockKey,
        +                 int keySize)
        +
        2.3.4.11 Encryption Key Generation (Agile Encryption) + + ... continued ... + + The final hash data that is used for an encryption key is then generated by using the following + method: + + - H_final = H(H_n + blockKey) + + where blockKey represents an array of bytes used to prevent two different blocks from encrypting + to the same cipher text. + + If the size of the resulting H_final is smaller than that of PasswordKeyEncryptor.keyBits, the key + MUST be padded by appending bytes with a value of 0x36. If the hash value is larger in size than + PasswordKeyEncryptor.keyBits, the key is obtained by truncating the hash value.
        +
        Parameters:
        passwordHash -
        hashAlgorithm -
        blockKey -
        keySize -
        +
        Returns:
        intermediate key
        +
      • +
      + + + +
        +
      • +

        getCipher

        +
        public static javax.crypto.Cipher getCipher(javax.crypto.SecretKey key,
        +                            CipherAlgorithm cipherAlgorithm,
        +                            ChainingMode chain,
        +                            byte[] vec,
        +                            int cipherMode)
        +
      • +
      + + + +
        +
      • +

        getCipher

        +
        public static javax.crypto.Cipher getCipher(javax.crypto.SecretKey key,
        +                            CipherAlgorithm cipherAlgorithm,
        +                            ChainingMode chain,
        +                            byte[] vec,
        +                            int cipherMode,
        +                            java.lang.String padding)
        +
        Parameters:
        key -
        chain -
        vec -
        cipherMode - Cipher.DECRYPT_MODE or Cipher.ENCRYPT_MODE
        +
        Returns:
        the requested cipher
        +
        Throws:
        +
        java.security.GeneralSecurityException
        +
      • +
      + + + +
        +
      • +

        getBlock36

        +
        public static byte[] getBlock36(byte[] hash,
        +                int size)
        +
      • +
      + + + +
        +
      • +

        getBlock0

        +
        public static byte[] getBlock0(byte[] hash,
        +               int size)
        +
      • +
      + + + +
        +
      • +

        getUtf16LeString

        +
        public static byte[] getUtf16LeString(java.lang.String str)
        +
      • +
      + + + +
        +
      • +

        getMessageDigest

        +
        public static java.security.MessageDigest getMessageDigest(HashAlgorithm hashAlgorithm)
        +
      • +
      + + + +
        +
      • +

        getMac

        +
        public static javax.crypto.Mac getMac(HashAlgorithm hashAlgorithm)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceDefinition.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceDefinition.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceDefinition.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceDefinition.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,283 @@ + + + + +DataSpaceMapUtils.DataSpaceDefinition (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Class DataSpaceMapUtils.DataSpaceDefinition

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.poi.poifs.crypt.DataSpaceMapUtils.DataSpaceDefinition
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceDefinition

        +
        public DataSpaceMapUtils.DataSpaceDefinition(java.lang.String[] transformer)
        +
      • +
      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceDefinition

        +
        public DataSpaceMapUtils.DataSpaceDefinition(LittleEndianInput is)
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMap.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMap.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMap.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMap.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,283 @@ + + + + +DataSpaceMapUtils.DataSpaceMap (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Class DataSpaceMapUtils.DataSpaceMap

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.poi.poifs.crypt.DataSpaceMapUtils.DataSpaceMap
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMapEntry.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMapEntry.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMapEntry.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceMapEntry.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,287 @@ + + + + +DataSpaceMapUtils.DataSpaceMapEntry (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Class DataSpaceMapUtils.DataSpaceMapEntry

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.poi.poifs.crypt.DataSpaceMapUtils.DataSpaceMapEntry
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceMapEntry

        +
        public DataSpaceMapUtils.DataSpaceMapEntry(int[] referenceComponentType,
        +                                   java.lang.String[] referenceComponent,
        +                                   java.lang.String dataSpaceName)
        +
      • +
      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceMapEntry

        +
        public DataSpaceMapUtils.DataSpaceMapEntry(LittleEndianInput is)
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + Added: poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceVersionInfo.html URL: http://svn.apache.org/viewvc/poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceVersionInfo.html?rev=1557428&view=auto ============================================================================== --- poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceVersionInfo.html (added) +++ poi/site/publish/apidocs/org/apache/poi/poifs/crypt/DataSpaceMapUtils.DataSpaceVersionInfo.html Sat Jan 11 17:39:46 2014 @@ -0,0 +1,295 @@ + + + + +DataSpaceMapUtils.DataSpaceVersionInfo (POI API Documentation) + + + + + + + + + + +
+
org.apache.poi.poifs.crypt
+

Class DataSpaceMapUtils.DataSpaceVersionInfo

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.poi.poifs.crypt.DataSpaceMapUtils.DataSpaceVersionInfo
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceVersionInfo

        +
        public DataSpaceMapUtils.DataSpaceVersionInfo(LittleEndianInput is)
        +
      • +
      + + + +
        +
      • +

        DataSpaceMapUtils.DataSpaceVersionInfo

        +
        public DataSpaceMapUtils.DataSpaceVersionInfo(java.lang.String featureIdentifier,
        +                                      int readerVersionMajor,
        +                                      int readerVersionMinor,
        +                                      int updaterVersionMajor,
        +                                      int updaterVersionMinor,
        +                                      int writerVersionMajor,
        +                                      int writerVersionMinor)
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + +

+ Copyright 2014 The Apache Software Foundation or + its licensors, as applicable. +

+ + --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org