Stay organized with collections
Save and categorize content based on your preferences.
IvParameterSpec
open class IvParameterSpec : AlgorithmParameterSpec
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.
Summary
Public constructors |
Creates an IvParameterSpec object using the bytes in iv as the IV.
|
Creates an IvParameterSpec object using the first len bytes in iv , beginning at offset inclusive, as the IV.
|
Public methods |
open ByteArray! |
Returns the initialization vector (IV).
|
Public constructors
IvParameterSpec
IvParameterSpec(iv: ByteArray!)
Creates an IvParameterSpec object using the bytes in iv
as the IV.
Parameters |
iv |
ByteArray!: the buffer with the IV. The contents of the buffer are copied to protect against subsequent modification. |
Exceptions |
java.lang.NullPointerException |
if iv is null |
IvParameterSpec
IvParameterSpec(
iv: ByteArray!,
offset: Int,
len: Int)
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 |
ByteArray!: the buffer with the IV. The first len bytes of the buffer beginning at offset inclusive are copied to protect against subsequent modification. |
offset |
Int: the offset in iv where the IV starts. |
len |
Int: the number of IV bytes. |
Exceptions |
java.lang.IllegalArgumentException |
if iv is null or (iv.length - offset < len) |
java.lang.ArrayIndexOutOfBoundsException |
is thrown if offset or len index bytes outside the iv . |
Public methods
getIV
open fun getIV(): ByteArray!
Returns the initialization vector (IV).
Return |
ByteArray! |
the initialization vector (IV). Returns a new array each time this method is called. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-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 2025-02-10 UTC."],[],[],null,["# IvParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nIvParameterSpec\n===============\n\n```\nopen class IvParameterSpec : AlgorithmParameterSpec\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.crypto.spec.IvParameterSpec](#) |\n\nThis 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.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [IvParameterSpec](#IvParameterSpec(kotlin.ByteArray))`(`iv:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Creates an IvParameterSpec object using the bytes in `iv` as the IV. |\n| [IvParameterSpec](#IvParameterSpec(kotlin.ByteArray,%20kotlin.Int,%20kotlin.Int))`(`iv:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`, `offset:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `len:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an IvParameterSpec object using the first `len` bytes in `iv`, beginning at `offset` inclusive, as the IV. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------|\n| open [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)! | [getIV](#getIV())`()` Returns the initialization vector (IV). |\n\nPublic constructors\n-------------------\n\n### IvParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIvParameterSpec(iv: ByteArray!)\n```\n\nCreates an IvParameterSpec object using the bytes in `iv` as the IV.\n\n| Parameters ||\n|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `iv` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!: the buffer with the IV. The contents of the buffer are copied to protect against subsequent modification. |\n\n| Exceptions ||\n|----------------------------------|-------------------|\n| `java.lang.NullPointerException` | if `iv` is `null` |\n\n### IvParameterSpec\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIvParameterSpec(\n iv: ByteArray!, \n offset: Int, \n len: Int)\n```\n\nCreates an IvParameterSpec object using the first `len` bytes in `iv`, beginning at `offset` inclusive, as the IV.\n\nThe bytes that constitute the IV are those between `iv[offset]` and `iv[offset+len-1]` inclusive.\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `iv` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!: 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` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the offset in `iv` where the IV starts. |\n| `len` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the number of IV bytes. |\n\n| Exceptions ||\n|--------------------------------------------|--------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if `iv` is `null` or `(iv.length - offset \u003c len)` |\n| `java.lang.ArrayIndexOutOfBoundsException` | is thrown if `offset` or `len` index bytes outside the `iv`. |\n\nPublic methods\n--------------\n\n### getIV\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getIV(): ByteArray!\n```\n\nReturns the initialization vector (IV).\n\n| Return ||\n|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)! | the initialization vector (IV). Returns a new array each time this method is called. |"]]