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

com.unbound.kmip.object.ManagedObject 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.object;

import com.unbound.kmip.KMIP;
import com.unbound.kmip.KMIPConvertException;
import com.unbound.kmip.KMIPConverter;

/**
 * Created by valery.osheter on 19-Nov-15.
 */
public abstract class ManagedObject
{
  public int tag;

  public ManagedObject(int _tag)
  {
    tag = _tag;
  }

  public abstract void convert(KMIPConverter converter) throws KMIPConvertException;

  public static ManagedObject create(int tag) throws KMIPConvertException
  {
    if (tag == KMIP.Tag.Certificate) return new Certificate();
    if (tag == KMIP.Tag.SymmetricKey) return new SymmetricKey();
    if (tag == KMIP.Tag.PrivateKey) return new PrivateKey();
    if (tag == KMIP.Tag.PublicKey) return new PublicKey();
    if (tag == KMIP.Tag.SecretData) return new SecretData();
    if (tag == KMIP.Tag.OpaqueObject) return new OpaqueObject();
    if (tag == KMIP.Tag.Template) return new Template();
    if (tag == KMIP.Tag.PGPKey) return new PGPKey();
    KMIPConverter.setError("Unexpected ManagedObject type " + tag);
    return null;
  }

  abstract public int getKMIPObjectType();
  abstract public void log();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy