public CiphertextHeaders(final byte version,final CiphertextType type,final CryptoAlgorithm cryptoAlgo,final byte[] encryptionContext,final List<KeyBlob> keyBlobs,final ContentType contentType,final int frameSize){
  version_=version;
  typeVal_=type.getValue();
  cryptoAlgoVal_=cryptoAlgo.getValue();
  encryptionContext_=encryptionContext.clone();
  if (encryptionContext_.length > Constants.UNSIGNED_SHORT_MAX_VAL) {
    throw new AwsCryptoException("Size of encryption context exceeds the allowed maximum " + Constants.UNSIGNED_SHORT_MAX_VAL);
  }
  encryptionContextLen_=encryptionContext.length;
  cipherKeyCount_=keyBlobs.size();
  cipherKeyBlobs_=new ArrayList<>(keyBlobs);
  contentTypeVal_=contentType.getValue();
  reservedField_=0;
  nonceLen_=cryptoAlgo.getNonceLen();
  messageId_=new byte[Constants.MESSAGE_ID_LEN];
  RND.nextBytes(messageId_);
  frameLength_=frameSize;
}

public CiphertextHeaders ( final byte version , final CiphertextType type , final CryptoAlgorithm cryptoAlgo , final byte [ ] encryptionContext , final List < KeyBlob > keyBlobs , final ContentType contentType , final int frameSize ) { version_ = version ; typeVal_ = type . getValue ( ) ; cryptoAlgoVal_ = cryptoAlgo . getValue ( ) ; encryptionContext_ = encryptionContext . clone ( ) ; if ( encryptionContext_ . length > Constants . UNSIGNED_SHORT_MAX_VAL ) { throw new AwsCryptoException ( "Size of encryption context exceeds the allowed maximum " + Constants . UNSIGNED_SHORT_MAX_VAL ) ; } encryptionContextLen_ = encryptionContext . length ; cipherKeyCount_ = keyBlobs . size ( ) ; cipherKeyBlobs_ = new ArrayList < > ( keyBlobs ) ; contentTypeVal_ = contentType . getValue ( ) ; reservedField_ = 0 ; nonceLen_ = cryptoAlgo . getNonceLen ( ) ; messageId_ = new byte [ Constants . MESSAGE_ID_LEN ] ; RND . nextBytes ( messageId_ ) ; frameLength_ = frameSize ; }
construct the ciphertext headers using the provided values .
