1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package be.belgium.eid;
/******************************************************************************//**
* Container class for all certificates on the card
*********************************************************************************/
public class BEID_Certificates extends BEID_Crypto {
private long swigCPtr;
protected BEID_Certificates(long cPtr, boolean cMemoryOwn) {
super(beidlibJava_WrapperJNI.SWIGBEID_CertificatesUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
protected static long getCPtr(BEID_Certificates obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if(swigCPtr != 0 && swigCMemOwn) {
swigCMemOwn = false;
beidlibJava_WrapperJNI.delete_BEID_Certificates(swigCPtr);
}
swigCPtr = 0;
super.delete();
}
/**
* Create a BEID_Certificates store without any link to a card.
* This store is not linked to any card, therefore some methods can not be used
* and throw a BEID_ExBadUsage exception.
*/
public BEID_Certificates() {
this(beidlibJava_WrapperJNI.new_BEID_Certificates(), true);
}
/** The number of certificates that were read from the card */
public long countFromCard() throws java.lang.Exception {
return beidlibJava_WrapperJNI.BEID_Certificates_countFromCard(swigCPtr, this);
}
/** The total number of certificates in the container (from a card or not) */
public long countAll() throws java.lang.Exception {
return beidlibJava_WrapperJNI.BEID_Certificates_countAll(swigCPtr, this);
}
/**
* Get a certificate from the card by index
* Throw BEID_ExParamRange exception if the index is out of range
*/
public BEID_Certificate getCertFromCard(long ulIndexCard) throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getCertFromCard(swigCPtr, this, ulIndexCard), false);
}
/**
* Get a certificate from the container by index
*
* ATTENTION ulIndexAll and ulIndexCard are two different indexes
* The index will change if new certificates are added with addCert()
*/
public BEID_Certificate getCert(long ulIndexAll) throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getCert__SWIG_0(swigCPtr, this, ulIndexAll), false);
}
/**
* Get a certificate by type
*/
public BEID_Certificate getCert(BEID_CertifType type) throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getCert__SWIG_1(swigCPtr, this, type.swigValue()), false);
}
/** Get the RRN certificate from the card */
public BEID_Certificate getRrn() {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getRrn(swigCPtr, this), false);
}
/** Get the root certificate from the card */
public BEID_Certificate getRoot() throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getRoot(swigCPtr, this), false);
}
/** Get the ca certificate from the card */
public BEID_Certificate getCA() throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getCA(swigCPtr, this), false);
}
/** Get the signature certificate from the card */
public BEID_Certificate getSignature() throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getSignature(swigCPtr, this), false);
}
/** Get the authentication certificate from the card */
public BEID_Certificate getAuthentication() throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_getAuthentication(swigCPtr, this), false);
}
/**
* Add a new certificate to the store
*/
public BEID_Certificate addCertificate(BEID_ByteArray cert) throws java.lang.Exception {
return new BEID_Certificate(beidlibJava_WrapperJNI.BEID_Certificates_addCertificate(swigCPtr, this, BEID_ByteArray.getCPtr(cert), cert), false);
}
}
|