00001
00002
00003
00004
00005
00006
00007
00008
00009 package com.orionsec.jpkif;
00010
00011 public class CPKIFKeyMaterial {
00012 private long swigCPtr;
00013 protected boolean swigCMemOwn;
00014
00015 public CPKIFKeyMaterial(long cPtr, boolean cMemoryOwn) {
00016 swigCMemOwn = cMemoryOwn;
00017 swigCPtr = cPtr;
00018 }
00019
00020 public static long getCPtr(CPKIFKeyMaterial obj) {
00021 return (obj == null) ? 0 : obj.swigCPtr;
00022 }
00023
00024 protected void finalize() {
00025 delete();
00026 }
00027
00028 public synchronized void delete() {
00029 if (swigCPtr != 0) {
00030 if (swigCMemOwn) {
00031 swigCMemOwn = false;
00032 pkif_moduleJNI.delete_CPKIFKeyMaterial(swigCPtr);
00033 }
00034 swigCPtr = 0;
00035 }
00036 }
00037
00038 public CPKIFKeyMaterial() {
00039 this(pkif_moduleJNI.new_CPKIFKeyMaterial(), true);
00040 }
00041
00042 public boolean ContainsSymmetricKeyMaterial() {
00043 return pkif_moduleJNI.CPKIFKeyMaterial_ContainsSymmetricKeyMaterial(swigCPtr, this);
00044 }
00045
00046 public boolean ContainsCertificate() {
00047 return pkif_moduleJNI.CPKIFKeyMaterial_ContainsCertificate(swigCPtr, this);
00048 }
00049
00050 public boolean ContainsPublicKeyMaterial() {
00051 return pkif_moduleJNI.CPKIFKeyMaterial_ContainsPublicKeyMaterial(swigCPtr, this);
00052 }
00053
00054 public void SetSubjectPublicKeyInfo(CPKIFSubjectPublicKeyInfoPtr spki) {
00055 pkif_moduleJNI.CPKIFKeyMaterial_SetSubjectPublicKeyInfo(swigCPtr, this, CPKIFSubjectPublicKeyInfoPtr.getCPtr(spki), spki);
00056 }
00057
00058 public CPKIFSubjectPublicKeyInfoPtr GetSubjectPublicKeyInfo() {
00059 return new CPKIFSubjectPublicKeyInfoPtr(pkif_moduleJNI.CPKIFKeyMaterial_GetSubjectPublicKeyInfo(swigCPtr, this), true);
00060 }
00061
00062 public void SetCertificate(byte[] cert, int certLen) {
00063 pkif_moduleJNI.CPKIFKeyMaterial_SetCertificate(swigCPtr, this, cert, certLen);
00064 }
00065
00066 public void GetCertificate(byte[] cert, SWIGTYPE_p_int certLen) {
00067 pkif_moduleJNI.CPKIFKeyMaterial_GetCertificate__SWIG_0(swigCPtr, this, cert, SWIGTYPE_p_int.getCPtr(certLen));
00068 }
00069
00070 public byte[] GetCertificate() {
00071 byte[] ret = pkif_moduleJNI.CPKIFKeyMaterial_GetCertificate__SWIG_1(swigCPtr, this);
00072 return ret;
00073 }
00074
00075 public int GetCertificateLength() {
00076 return pkif_moduleJNI.CPKIFKeyMaterial_GetCertificateLength(swigCPtr, this);
00077 }
00078
00079 public void SetWorkingParameters(CPKIFAlgorithmIdentifierPtr algID) {
00080 pkif_moduleJNI.CPKIFKeyMaterial_SetWorkingParameters(swigCPtr, this, CPKIFAlgorithmIdentifierPtr.getCPtr(algID), algID);
00081 }
00082
00083 public CPKIFAlgorithmIdentifierPtr GetWorkingParameters() {
00084 return new CPKIFAlgorithmIdentifierPtr(pkif_moduleJNI.CPKIFKeyMaterial_GetWorkingParameters(swigCPtr, this), true);
00085 }
00086
00087 public void SetIV(byte[] key, int keyLen) {
00088 pkif_moduleJNI.CPKIFKeyMaterial_SetIV(swigCPtr, this, key, keyLen);
00089 }
00090
00091 public void GetIV(byte[] key, SWIGTYPE_p_int keyLen) {
00092 pkif_moduleJNI.CPKIFKeyMaterial_GetIV__SWIG_0(swigCPtr, this, key, SWIGTYPE_p_int.getCPtr(keyLen));
00093 }
00094
00095 public byte[] GetIV() {
00096 byte[] ret = pkif_moduleJNI.CPKIFKeyMaterial_GetIV__SWIG_1(swigCPtr, this);
00097 return ret;
00098 }
00099
00100 public void SetMode(SYMKEY_MODE mode) {
00101 pkif_moduleJNI.CPKIFKeyMaterial_SetMode(swigCPtr, this, mode.swigValue());
00102 }
00103
00104 public SYMKEY_MODE GetMode() {
00105 return SYMKEY_MODE.swigToEnum(pkif_moduleJNI.CPKIFKeyMaterial_GetMode(swigCPtr, this));
00106 }
00107
00108 public void SetSymmetricKey(byte[] key, int keyLen) {
00109 pkif_moduleJNI.CPKIFKeyMaterial_SetSymmetricKey(swigCPtr, this, key, keyLen);
00110 }
00111
00112 public void GetSymmetricKey(byte[] key, SWIGTYPE_p_int keyLen, SWIGTYPE_p_PKIFCRYPTO__SYMKEY_ALG alg) {
00113 pkif_moduleJNI.CPKIFKeyMaterial_GetSymmetricKey__SWIG_0(swigCPtr, this, key, SWIGTYPE_p_int.getCPtr(keyLen), SWIGTYPE_p_PKIFCRYPTO__SYMKEY_ALG.getCPtr(alg));
00114 }
00115
00116 public byte[] GetSymmetricKey() {
00117 byte[] ret = pkif_moduleJNI.CPKIFKeyMaterial_GetSymmetricKey__SWIG_1(swigCPtr, this);
00118 return ret;
00119 }
00120
00121 public int GetSymmetricKeyLength() {
00122 return pkif_moduleJNI.CPKIFKeyMaterial_GetSymmetricKeyLength(swigCPtr, this);
00123 }
00124
00125 public SYMKEY_ALG GetSymmetricKeyAlgorithm() {
00126 return SYMKEY_ALG.swigToEnum(pkif_moduleJNI.CPKIFKeyMaterial_GetSymmetricKeyAlgorithm(swigCPtr, this));
00127 }
00128
00129 public void SetSymmetricKeyAlgorithm(SYMKEY_ALG alg) {
00130 pkif_moduleJNI.CPKIFKeyMaterial_SetSymmetricKeyAlgorithm(swigCPtr, this, alg.swigValue());
00131 }
00132
00133 public static CPKIFKeyMaterialPtr CreateWithSymmetricKey(CPKIFKeyMaterialPtr km) {
00134 return new CPKIFKeyMaterialPtr(pkif_moduleJNI.CPKIFKeyMaterial_CreateWithSymmetricKey(CPKIFKeyMaterialPtr.getCPtr(km), km), true);
00135 }
00136
00137 }