![JAR search and dependency download from the Maven repository](/logo.png)
com.dyadicsec.cryptoki.CKR_Exception Maven / Gradle / Ivy
package com.dyadicsec.cryptoki;
public class CKR_Exception extends java.lang.Exception
{
public int errorCode;
public String functionName;
public String getMessage()
{
if (functionName==null) return "Library errorCode=0x" + Integer.toHexString(errorCode);
return "Library." + functionName + " failed, errorCode=0x" + Integer.toHexString(errorCode);
}
CKR_Exception(int errorCode, java.lang.Exception src) {
super(src);
this.errorCode = errorCode;
}
CKR_Exception(int errorCode) {
this.errorCode = errorCode;
}
CKR_Exception(int errorCode, String functionName) {
this.errorCode = errorCode;
}
static void check(long rv) throws CKR_Exception
{
int errorCode = (int)(rv>>32);
if (errorCode!=0) throw new CKR_Exception(errorCode);
}
static void check(long rv, String function) throws CKR_Exception
{
int errorCode = (int)(rv>>32);
if (errorCode!=0) throw new CKR_Exception(errorCode, function);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy