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

com.unbound.kmip.request.SignRequest Maven / Gradle / Ivy

Go to download

This is a collection of JAVA libraries that implement Unbound cryptographic classes for JAVA provider, PKCS11 wrapper, cryptoki, and advapi

There is a newer version: 42761
Show newest version
package com.unbound.kmip.request;

import com.unbound.common.Log;
import com.unbound.kmip.KMIP;
import com.unbound.kmip.KMIPConvertException;
import com.unbound.kmip.KMIPConverter;
import com.unbound.kmip.attribute.CryptoParams;

/**
 * Created by valery.osheter on 26-Nov-15.
 */
public class SignRequest extends RequestItem
{
  public SignRequest()
  {
    super(KMIP.Operation.Sign);
  }

  public String uid = null;
  public CryptoParams params = null;
  public byte[] data = null;
  public byte[] corr = null;
  public Boolean initInd = null;
  public Boolean finalInd = null;

  public void convert(KMIPConverter converter) throws KMIPConvertException
  {
    uid = converter.convert(KMIP.Tag.UniqueIdentifier, uid);

    if (!converter.isWrite() && converter.getNextTag() == KMIP.Tag.CryptographicParameters)
      params = new CryptoParams();
    if (params != null) params.convertValue(converter);

    data = converter.convert(KMIP.Tag.Data, data);
    corr = converter.convertOptional(KMIP.Tag.CorrelationValue, corr);
    initInd = converter.convertOptional(KMIP.Tag.InitIndicator, initInd);
    finalInd = converter.convertOptional(KMIP.Tag.FinalIndicator, finalInd);
  }

  public void log()
  {
    Log log = Log.func("SignRequest").
      log("uid", uid).
      logLen("dataLen", data).
      log("initInd", initInd).
      log("finalInd", finalInd).
    end();
    if (params!=null) params.log();
    log.leave();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy