00001
00002
00003
00004
00005
00006
00007
00008
00009 package com.orionsec.jpkif;
00010
00011 public class CPKIFNSSRaw extends IPKIFColleague {
00012 private long swigCPtr;
00013
00014 public CPKIFNSSRaw(long cPtr, boolean cMemoryOwn) {
00015 super(pkif_moduleJNI.CPKIFNSSRaw_SWIGUpcast(cPtr), cMemoryOwn);
00016 swigCPtr = cPtr;
00017 }
00018
00019 public static long getCPtr(CPKIFNSSRaw obj) {
00020 return (obj == null) ? 0 : obj.swigCPtr;
00021 }
00022
00023 protected void finalize() {
00024 delete();
00025 }
00026
00027 public synchronized void delete() {
00028 if (swigCPtr != 0) {
00029 if (swigCMemOwn) {
00030 swigCMemOwn = false;
00031 pkif_moduleJNI.delete_CPKIFNSSRaw(swigCPtr);
00032 }
00033 swigCPtr = 0;
00034 }
00035 super.delete();
00036 }
00037
00038 public CPKIFNSSRaw(String dbdir) {
00039 this(pkif_moduleJNI.new_CPKIFNSSRaw__SWIG_0(dbdir), true);
00040 }
00041
00042 public CPKIFNSSRaw() {
00043 this(pkif_moduleJNI.new_CPKIFNSSRaw__SWIG_1(), true);
00044 }
00045
00046 public void Initialize() {
00047 pkif_moduleJNI.CPKIFNSSRaw_Initialize(swigCPtr, this);
00048 }
00049
00050 public void GenRandom(byte[] buf, int len) {
00051 pkif_moduleJNI.CPKIFNSSRaw_GenRandom(swigCPtr, this, buf, len);
00052 }
00053
00054 public IPKIFHashContext HashInit(HASH_ALG alg) {
00055 long cPtr = pkif_moduleJNI.CPKIFNSSRaw_HashInit(swigCPtr, this, alg.swigValue());
00056 return (cPtr == 0) ? null : new IPKIFHashContext(cPtr, false);
00057 }
00058
00059 public void HashUpdate(IPKIFHashContext hash, byte[] pData, int nDataLen) {
00060 pkif_moduleJNI.CPKIFNSSRaw_HashUpdate(swigCPtr, this, IPKIFHashContext.getCPtr(hash), hash, pData, nDataLen);
00061 }
00062
00063 public void HashFinal(IPKIFHashContext hash, byte[] pResult, SWIGTYPE_p_int pnResultLen) {
00064 pkif_moduleJNI.CPKIFNSSRaw_HashFinal(swigCPtr, this, IPKIFHashContext.getCPtr(hash), hash, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen));
00065 }
00066
00067 public boolean SupportsAlgorithm(CPKIFKeyMaterial key) {
00068 return pkif_moduleJNI.CPKIFNSSRaw_SupportsAlgorithm(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key);
00069 }
00070
00071 public void Sign(CPKIFKeyMaterial key, byte[] pHashData, int nHashDataLen, byte[] pSignature, SWIGTYPE_p_int nSignatureLen, HASH_ALG hashAlg) {
00072 pkif_moduleJNI.CPKIFNSSRaw_Sign(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pHashData, nHashDataLen, pSignature, SWIGTYPE_p_int.getCPtr(nSignatureLen), hashAlg.swigValue());
00073 }
00074
00075 public void Decrypt(CPKIFKeyMaterial key, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen, boolean pad) {
00076 pkif_moduleJNI.CPKIFNSSRaw_Decrypt__SWIG_0(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen), pad);
00077 }
00078
00079 public void Decrypt(CPKIFKeyMaterial key, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen) {
00080 pkif_moduleJNI.CPKIFNSSRaw_Decrypt__SWIG_1(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen));
00081 }
00082
00083 public void Encrypt(CPKIFKeyMaterial key, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen, boolean pad) {
00084 pkif_moduleJNI.CPKIFNSSRaw_Encrypt__SWIG_0(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen), pad);
00085 }
00086
00087 public void Encrypt(CPKIFKeyMaterial key, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen) {
00088 pkif_moduleJNI.CPKIFNSSRaw_Encrypt__SWIG_1(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen));
00089 }
00090
00091 public boolean Verify(CPKIFKeyMaterial key, byte[] pHashData, int nHashDataLen, byte[] pSignature, int nSignatureLen, HASH_ALG hashAlg) {
00092 return pkif_moduleJNI.CPKIFNSSRaw_Verify(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pHashData, nHashDataLen, pSignature, nSignatureLen, hashAlg.swigValue());
00093 }
00094
00095 public boolean VerifyCertificate(CPKIFCertificate issCert, CPKIFCertificate subCert) {
00096 return pkif_moduleJNI.CPKIFNSSRaw_VerifyCertificate(swigCPtr, this, CPKIFCertificate.getCPtr(issCert), issCert, CPKIFCertificate.getCPtr(subCert), subCert);
00097 }
00098
00099 public IPKIFRawCryptContext CryptInit(CPKIFKeyMaterial key, boolean pad) {
00100 long cPtr = pkif_moduleJNI.CPKIFNSSRaw_CryptInit__SWIG_0(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, pad);
00101 return (cPtr == 0) ? null : new IPKIFRawCryptContext(cPtr, false);
00102 }
00103
00104 public IPKIFRawCryptContext CryptInit(CPKIFKeyMaterial key) {
00105 long cPtr = pkif_moduleJNI.CPKIFNSSRaw_CryptInit__SWIG_1(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key);
00106 return (cPtr == 0) ? null : new IPKIFRawCryptContext(cPtr, false);
00107 }
00108
00109 public void Decrypt(IPKIFRawCryptContext cryptContext, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen, boolean arg5) {
00110 pkif_moduleJNI.CPKIFNSSRaw_Decrypt__SWIG_2(swigCPtr, this, IPKIFRawCryptContext.getCPtr(cryptContext), cryptContext, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen), arg5);
00111 }
00112
00113 public void Encrypt(IPKIFRawCryptContext cryptContext, byte[] pData, int nDataLen, byte[] pResult, SWIGTYPE_p_int pnResultLen, boolean arg5) {
00114 pkif_moduleJNI.CPKIFNSSRaw_Encrypt__SWIG_2(swigCPtr, this, IPKIFRawCryptContext.getCPtr(cryptContext), cryptContext, pData, nDataLen, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen), arg5);
00115 }
00116
00117 public IPKIFRawCryptContext HMACInit(CPKIFKeyMaterial key, HASH_ALG ha) {
00118 long cPtr = pkif_moduleJNI.CPKIFNSSRaw_HMACInit(swigCPtr, this, CPKIFKeyMaterial.getCPtr(key), key, ha.swigValue());
00119 return (cPtr == 0) ? null : new IPKIFRawCryptContext(cPtr, false);
00120 }
00121
00122 public void HMACUpdate(IPKIFRawCryptContext ctx, byte[] pData, int nDataLen) {
00123 pkif_moduleJNI.CPKIFNSSRaw_HMACUpdate(swigCPtr, this, IPKIFRawCryptContext.getCPtr(ctx), ctx, pData, nDataLen);
00124 }
00125
00126 public void HMACFinal(IPKIFRawCryptContext ctx, byte[] pResult, SWIGTYPE_p_int pnResultLen) {
00127 pkif_moduleJNI.CPKIFNSSRaw_HMACFinal(swigCPtr, this, IPKIFRawCryptContext.getCPtr(ctx), ctx, pResult, SWIGTYPE_p_int.getCPtr(pnResultLen));
00128 }
00129
00130 public final static int thisComponent = pkif_moduleJNI.CPKIFNSSRaw_thisComponent_get();
00131
00132 }