public class GCMParameterSpec extends Object implements AlgorithmParameterSpec
Cipher使用伽罗瓦/计数器模式(GCM)模式。 
        简单的块密码模式(如CBC)通常仅需要初始化向量(如IvParameterSpec ),但是GCM需要这些参数: 
IV :初始化向量(IV) tLen :认证标签T的长度(以比特为单位)  除了这里描述的参数之外,其他GCM输入/输出(附加认证数据(AAD),密钥,分组密码,简单/密文和认证标签)都在Cipher类中处理。 
有关具有关联数据(AEAD)算法的认证加密的更多信息,以及NIST Special Publication 800-38D “NIST推荐用于块密码操作模式:伽罗瓦/计数器模式(GCM)和GMAC”的信息,请参见RFC 5116 。
 GCM规范指出,对于tLen应用程序, tLen可能只有值{ tLen }或{64,32}。 可以为此类指定其他值,但并不是所有的CSP实现都将支持它们。 
Cipher 
       | Constructor and Description | 
|---|
| GCMParameterSpec(int tLen, byte[] src)
              使用指定的认证标签位长度和IV缓冲区构造GCMParameterSpec。 
             | 
| GCMParameterSpec(int tLen, byte[] src, int offset, int len)
              使用指定的身份验证标记位长度和指定缓冲区的子集作为IV构造一个GCMParameterSpec对象。 
             | 
public GCMParameterSpec(int tLen,
                        byte[] src) 
          tLen - 认证标签长度(以位为单位) 
           src - IV源缓冲区。 
            复制缓冲区的内容以防止后续修改。 
           IllegalArgumentException - 如果 
            tLen为负数,或 
            src为空。 
           public GCMParameterSpec(int tLen,
                        byte[] src,
                        int offset,
                        int len) 
          tLen - 认证标签长度(以位为单位) 
           src - IV源缓冲区。 
            复制缓冲区的内容以防止后续修改。 
           offset - 偏移在 
            src其中IV开始 
           len - IV字节数 
           IllegalArgumentException - 如果 
            tLen为负,则 
            src为空, 
            len或 
            offset为否定,或 
            offset和 
            len的总和大于 
            src字节数组的长度。 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.