IvParameterSpec
Stay organized with collections
Save and categorize content based on your preferences.
This class specifies an initialization vector (IV).
Examples which use IVs are ciphers in feedback mode,
e.g., DES in CBC mode and RSA ciphers with OAEP encoding
operation.
Public Constructor Summary
|
IvParameterSpec(byte[] iv)
Creates an IvParameterSpec object using the bytes in iv
as the IV.
|
|
IvParameterSpec(byte[] iv, int offset, int len)
Creates an IvParameterSpec object using the first len
bytes in iv , beginning at offset
inclusive, as the IV.
|
Public Method Summary
byte[]
|
getIV()
Returns the initialization vector (IV).
|
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
IvParameterSpec
(byte[] iv)
Creates an IvParameterSpec object using the bytes in iv
as the IV.
Parameters
iv |
the buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification. |
public
IvParameterSpec
(byte[] iv, int offset, int len)
Creates an IvParameterSpec object using the first len
bytes in iv
, beginning at offset
inclusive, as the IV.
The bytes that constitute the IV are those between
iv[offset]
and iv[offset+len-1]
inclusive.
Parameters
iv |
the buffer with the IV. The first len
bytes of the buffer beginning at offset inclusive
are copied to protect against subsequent modification. |
offset |
the offset in iv where the IV
starts. |
len |
the number of IV bytes. |
Public Methods
public
byte[]
getIV
()
Returns the initialization vector (IV).
Returns
- the initialization vector (IV). Returns a new array
each time this method is called.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eIvParameterSpec\u003c/code\u003e specifies an initialization vector (IV) used by ciphers in feedback mode, such as DES in CBC mode and RSA with OAEP encoding.\u003c/p\u003e\n"],["\u003cp\u003eIt provides constructors to create an \u003ccode\u003eIvParameterSpec\u003c/code\u003e object from a byte array, specifying either the entire array or a specific range within the array as the IV.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetIV()\u003c/code\u003e method returns a copy of the initialization vector.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIvParameterSpec\u003c/code\u003e is an implementation of \u003ccode\u003eAlgorithmParameterSpec\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["public class **IvParameterSpec** extends [Object](../../../../reference/java/lang/Object.html) \nimplements [AlgorithmParameterSpec](../../../../reference/java/security/spec/AlgorithmParameterSpec.html) \nThis class specifies an *initialization vector* (IV).\nExamples which use IVs are ciphers in feedback mode,\ne.g., DES in CBC mode and RSA ciphers with OAEP encoding\noperation. \n\nPublic Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [IvParameterSpec](../../../../reference/javax/crypto/spec/IvParameterSpec.html#IvParameterSpec(byte[]))(byte\\[\\] iv) Creates an IvParameterSpec object using the bytes in `iv` as the IV. |\n| | [IvParameterSpec](../../../../reference/javax/crypto/spec/IvParameterSpec.html#IvParameterSpec(byte[],%20int,%20int))(byte\\[\\] iv, int offset, int len) Creates an IvParameterSpec object using the first `len` bytes in `iv`, beginning at `offset` inclusive, as the IV. |\n\nPublic Method Summary\n\n|----------|-------------------------------------------------------------------------------------------------------------------------|\n| byte\\[\\] | [getIV](../../../../reference/javax/crypto/spec/IvParameterSpec.html#getIV())() Returns the initialization vector (IV). |\n\nInherited Method Summary \nFrom class [java.lang.Object](../../../../reference/java/lang/Object.html) \n\n|----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](../../../../reference/java/lang/Object.html) | [clone](../../../../reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |\n| boolean | [equals](../../../../reference/java/lang/Object.html#equals(java.lang.Object))([Object](../../../../reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |\n| void | [finalize](../../../../reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |\n| final [Class](../../../../reference/java/lang/Class.html)\\\u003c?\\\u003e | [getClass](../../../../reference/java/lang/Object.html#getClass())() Returns the unique instance of [Class](../../../../reference/java/lang/Class.html) that represents this object's class. |\n| int | [hashCode](../../../../reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |\n| final void | [notify](../../../../reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| final void | [notifyAll](../../../../reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| [String](../../../../reference/java/lang/String.html) | [toString](../../../../reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |\n\nPublic Constructors \n\npublic\n**IvParameterSpec**\n(byte\\[\\] iv) \nCreates an IvParameterSpec object using the bytes in `iv`\nas the IV. \n\nParameters\n\n| iv | the buffer with the IV. The contents of the buffer are copied to protect against subsequent modification. |\n|----|-----------------------------------------------------------------------------------------------------------|\n\nThrows\n\n| [NullPointerException](../../../../reference/java/lang/NullPointerException.html) | if `iv` is `null` |\n|-----------------------------------------------------------------------------------|-------------------|\n\npublic\n**IvParameterSpec**\n(byte\\[\\] iv, int offset, int len) \nCreates an IvParameterSpec object using the first `len`\nbytes in `iv`, beginning at `offset`\ninclusive, as the IV.\n\nThe bytes that constitute the IV are those between\n`iv[offset]` and `iv[offset+len-1]` inclusive. \n\nParameters\n\n| iv | the buffer with the IV. The first `len` bytes of the buffer beginning at `offset` inclusive are copied to protect against subsequent modification. |\n| offset | the offset in `iv` where the IV starts. |\n| len | the number of IV bytes. |\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n\nThrows\n\n| [IllegalArgumentException](../../../../reference/java/lang/IllegalArgumentException.html) | if `iv` is `null` or `(iv.length - offset \u003c len)` |\n| [ArrayIndexOutOfBoundsException](../../../../reference/java/lang/ArrayIndexOutOfBoundsException.html) | is thrown if `offset` or `len` index bytes outside the `iv`. |\n|-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n\nPublic Methods \n\npublic byte\\[\\]\n**getIV**\n() \nReturns the initialization vector (IV). \n\nReturns\n\n- the initialization vector (IV). Returns a new array each time this method is called."]]