com.unbound.kmip.attribute.Digest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unbound-java-provider Show documentation
Show all versions of unbound-java-provider Show documentation
This is a collection of JAVA libraries that implement Unbound cryptographic classes for JAVA provider, PKCS11 wrapper, cryptoki, and advapi
package com.unbound.kmip.attribute;
import com.unbound.common.Log;
import com.unbound.kmip.KMIP;
import com.unbound.kmip.KMIPConvertException;
import com.unbound.kmip.KMIPConverter;
/**
* Created by valery.osheter on 19-Nov-15.
*/
public class Digest extends Attribute
{
public int hashingAlg = 0;
public byte[] value = null;
public Integer keyFormat = null;
public Digest()
{
super(KMIP.Tag.Digest);
}
public Digest(byte[] value, int hashingAlg, Integer keyFormat)
{
this();
this.value = value;
this.hashingAlg = hashingAlg;
this.keyFormat = keyFormat;
}
public void convert(KMIPConverter converter) throws KMIPConvertException
{
int begin = converter.convertBegin(KMIP.tagAttributeValue(KMIP.TagType.Structure));
hashingAlg = converter.convert(KMIP.Tag.HashingAlgorithm, hashingAlg);
value = converter.convertOptional(KMIP.Tag.DigestValue, value);
keyFormat = converter.convertOptional(KMIP.Tag.KeyFormatType, keyFormat);
converter.convertEnd(begin);
}
public void log()
{
Log.print("Digest").
log("hashingAlg", hashingAlg).
log("keyFormat", keyFormat).
logLen("valueLen", value).
end();
}
}