/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key. * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key); initKey = key; isInit = true; }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key and algorithm parameters. * * @param key * the key to initialize this instance with. * @param param * the parameters for this exemption mechanism algorithm. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws InvalidAlgorithmParameterException * the the parameters cannot be used to initialize this * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key, AlgorithmParameterSpec param) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key, param); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism and stores it * into the {@code output} buffer at offset {@code outputOffset}. * * @param output * the output buffer for the result key blob. * @param outputOffset * the offset in the output buffer to start. * @return the number of bytes written to the {@code output} buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ShortBufferException * if the provided buffer is too small for the result key blob. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final int genExemptionBlob(byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; int len = spiImpl.engineGenExemptionBlob(output, outputOffset); generated = true; return len; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key and algorithm parameters. * * @param key * the key to initialize this instance with. * @param param * the parameters for this exemption mechanism algorithm. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws InvalidAlgorithmParameterException * if the parameters cannot be used to initialize this * mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key, AlgorithmParameters param) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key, param); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key. * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key. * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key. * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }
/** * Returns the size in bytes for the output buffer needed to hold the output * of the next {@link #genExemptionBlob} call, given the specified {@code * inputLen} (in bytes). * * @param inputLen * the specified input length (in bytes). * @return the size in bytes for the output buffer. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. */ public final int getOutputSize(int inputLen) throws IllegalStateException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } return spiImpl.engineGetOutputSize(inputLen); }
/** * Initializes this {@code ExemptionMechanism} instance with the * specified key. * * @param key * the key to initialize this instance with. * @throws InvalidKeyException * if the key cannot be used to initialize this mechanism. * @throws ExemptionMechanismException * if error(s) occur during initialization. */ public final void init(Key key) throws InvalidKeyException, ExemptionMechanismException { generated = false; spiImpl.engineInit(key); initKey = key; isInit = true; }
/** * Generates the result key blob for this exemption mechanism. * * @return the result key blob for this exemption mechanism. * @throws IllegalStateException * if this {@code ExemptionMechanism} instance is not * initialized. * @throws ExemptionMechanismException * if error(s) occur during generation. */ public final byte[] genExemptionBlob() throws IllegalStateException, ExemptionMechanismException { if (!isInit) { throw new IllegalStateException("ExemptionMechanism is not initialized"); } generated = false; byte[] result = spiImpl.engineGenExemptionBlob(); generated = true; return result; }