1 /* 2 * @(#)IvParameterSpec.java 1.9 04/03/15 3 * 4 * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 /* 9 * NOTE: 10 * Because of various external restrictions (i.e. US export 11 * regulations, etc.), the actual source code can not be provided 12 * at this time. This file represents the skeleton of the source 13 * file, so that javadocs of the API can be created. 14 */ 15 16 package javax.crypto.spec; 17 18 import java.security.spec.AlgorithmParameterSpec; 19 20 /** 21 * This class specifies an <i>initialization vector</i> (IV). 22 * Examples which use IVs are ciphers in feedback mode, 23 * e.g., DES in CBC mode and RSA ciphers with OAEP encoding 24 * operation. 25 * 26 * @author Jan Luehe 27 * 28 * @version 1.21, 03/15/04 29 * @since 1.4 30 */ 31 public class IvParameterSpec implements AlgorithmParameterSpec 32 { 33 34 /** 35 * Creates an IvParameterSpec object using the bytes in <code>iv</code> 36 * as the IV. 37 * 38 * @param iv the buffer with the IV. The contents of the 39 * buffer are copied to protect against subsequent modification. 40 * @throws NullPointerException if <code>iv</code> is <code>null</code> 41 */ 42 public IvParameterSpec(byte[] iv) { } 43 44 /** 45 * Creates an IvParameterSpec object using the first <code>len</code> 46 * bytes in <code>iv</code>, beginning at <code>offset</code> 47 * inclusive, as the IV. 48 * 49 * <p> The bytes that constitute the IV are those between 50 * <code>iv[offset]</code> and <code>iv[offset+len-1]</code> inclusive. 51 * 52 * @param iv the buffer with the IV. The first <code>len</code> 53 * bytes of the buffer beginning at <code>offset</code> inclusive 54 * are copied to protect against subsequent modification. 55 * @param offset the offset in <code>iv</code> where the IV 56 * starts. 57 * @param len the number of IV bytes. 58 * @throws IllegalArgumentException if <code>iv</code> is <code>null</code> 59 * or <code>(iv.length - offset < len)</code> 60 * @throws ArrayIndexOutOfBoundsException is thrown if <code>offset</code> 61 * or <code>len</code> index bytes outside the <code>iv</code>. 62 */ 63 public IvParameterSpec(byte[] iv, int offset, int len) { } 64 65 /** 66 * Returns the initialization vector (IV). 67 * 68 * @return the initialization vector (IV). Returns a new array 69 * each time this method is called. 70 */ 71 public byte[] getIV() { } 72 } 73