All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.com.ionic.sdk.agent.cipher.chunk.data.ChunkCryptoDecryptAttributes Maven / Gradle / Ivy

Go to download

The Ionic Java SDK provides an easy-to-use interface to the Ionic Platform.

There is a newer version: 2.9.0
Show newest version
package com.ionic.sdk.agent.cipher.chunk.data;

import com.ionic.sdk.agent.cipher.data.DecryptAttributes;
import com.ionic.sdk.core.annotation.InternalUseOnly;
import com.ionic.sdk.error.IonicException;
import com.ionic.sdk.error.SdkData;
import com.ionic.sdk.error.SdkError;

/**
 * On an Ionic SDK decrypt operation, this class provides the ability to specify request metadata that should be
 * sent to the server along with the cryptography key request.
 * 

* The key used for the decryption might have associated cryptography key attributes (fixed and mutable). This * information is communicated back to the SDK caller in this object. *

* The usage pattern for this object is to supply a fresh instance to each API call. The Ionic SDK will reject * any decrypt() operation that is attempted using a previously used {@link ChunkCryptoDecryptAttributes}. */ public class ChunkCryptoDecryptAttributes extends DecryptAttributes { /** * The identifier for the cipher used in the decryption operation. */ private String cipherId; /** * Constructor. */ public ChunkCryptoDecryptAttributes() { this.cipherId = ""; } /** * @return the identifier the Ionic chunk cipher implementation used in the decryption operation */ public final String getCipherId() { return cipherId; } /** * Set the cipher identifier associated with the decryption. *

* Ionic SDK clients should not call this function. Any value set prior to the decryption operation will cause * an {@link com.ionic.sdk.error.IonicException} to be thrown by the operation. * * @param cipherId the Ionic chunk cipher identifier associated with the decryption */ @InternalUseOnly public final void setCipherId(final String cipherId) { this.cipherId = cipherId; } /** * Verify that object is in the expected state prior to the Ionic server key request. *

* The usage pattern for this object is to supply a fresh instance to each SDK cryptography API call. The * Ionic SDK will reject an operation that is attempted using a previously used instance of this class. * * @throws IonicException on expectation failure */ public void validateInput() throws IonicException { final String className = getClass().getName(); SdkData.checkTrue("".equals(cipherId), SdkError.ISAGENT_INVALIDVALUE, className); SdkData.checkTrue(null == getKeyResponse(), SdkError.ISAGENT_INVALIDVALUE, className); SdkData.checkTrue(null == getServerErrorResponse(), SdkError.ISAGENT_INVALIDVALUE, className); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy