Difference between revisions of "JSS API"

From Dogtag
Jump to: navigation, search
m
m (Exceptions)
Line 46: Line 46:
 
= Exceptions =
 
= Exceptions =
  
To throw an exception:
+
See [https://github.com/dogtagpki/jss/wiki/Exceptions Exceptions].
 
 
<pre>
 
JSS_throw(JNIEnv *env, char *throwableClassName);
 
JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message);
 
JSS_throwMsgPrErrArg(JNIEnv *env, char *throwableClassName, char *message, PRErrorCode errCode);
 
JSS_throwMsgPrErr(JNIEnv *env, char *throwableClassName, char *message);
 
</pre>
 
 
 
Available exceptions:
 
 
 
<pre>
 
#define ALREADY_INITIALIZED_EXCEPTION "org/mozilla/jss/crypto/AlreadyInitializedException"
 
#define ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION "java/lang/ArrayIndexOutOfBoundsException"
 
#define INDEX_OUT_OF_BOUNDS_EXCEPTION "java/lang/IndexOutOfBoundsException"
 
#define BAD_PADDING_EXCEPTION "javax/crypto/BadPaddingException"
 
#define BIND_EXCEPTION "java/net/BindException"
 
#define CERT_DATABASE_EXCEPTION "org/mozilla/jss/CertDatabaseException"
 
#define CERTIFICATE_EXCEPTION "java/security/cert/CertificateException"
 
#define CERTIFICATE_ENCODING_EXCEPTION "java/security/cert/CertificateEncodingException"
 
#define CRL_IMPORT_EXCEPTION "org/mozilla/jss/CRLImportException"
 
#define DIGEST_EXCEPTION "java/security/DigestException"
 
#define GENERAL_SECURITY_EXCEPTION "java/security/GeneralSecurityException"
 
#define GENERIC_EXCEPTION "java/lang/Exception"
 
#define GIVE_UP_EXCEPTION "org/mozilla/jss/util/PasswordCallback$GiveUpException"
 
#define ILLEGAL_ARGUMENT_EXCEPTION "java/lang/IllegalArgumentException"
 
#define ILLEGAL_BLOCK_SIZE_EXCEPTION "org/mozilla/jss/crypto/IllegalBlockSizeException"
 
#define INCORRECT_PASSWORD_EXCEPTION "org/mozilla/jss/util/IncorrectPasswordException"
 
#define INTERRUPTED_IO_EXCEPTION "java/io/InterruptedIOException"
 
#define INVALID_DER_EXCEPTION "org/mozilla/jss/crypto/InvalidDERException"
 
#define INVALID_NICKNAME_EXCEPTION "org/mozilla/jss/util/InvalidNicknameException"
 
#define INVALID_KEY_FORMAT_EXCEPTION "org/mozilla/jss/crypto/InvalidKeyFormatException"
 
#define INVALID_PARAMETER_EXCEPTION "java/security/InvalidParameterException"
 
#define IO_EXCEPTION "java/io/IOException"
 
#define KEY_DATABASE_EXCEPTION "org/mozilla/jss/KeyDatabaseException"
 
#define KEY_EXISTS_EXCEPTION "org/mozilla/jss/crypto/KeyAlreadyImportedException"
 
#define KEYSTORE_EXCEPTION "java/security/KeyStoreException"
 
#define NICKNAME_CONFLICT_EXCEPTION "org/mozilla/jss/CryptoManager$NicknameConflictException"
 
#define NO_SUCH_ALG_EXCEPTION "java/security/NoSuchAlgorithmException"
 
#define NO_SUCH_ITEM_ON_TOKEN_EXCEPTION "org/mozilla/jss/crypto/NoSuchItemOnTokenException"
 
#define NO_SUCH_TOKEN_EXCEPTION "org/mozilla/jss/NoSuchTokenException"
 
#define NOT_EXTRACTABLE_EXCEPTION "org/mozilla/jss/crypto/SymmetricKey$NotExtractableException"
 
#define NULL_POINTER_EXCEPTION "java/lang/NullPointerException"
 
#define OBJECT_NOT_FOUND_EXCEPTION "org/mozilla/jss/crypto/ObjectNotFoundException"
 
#define OUT_OF_MEMORY_ERROR "java/lang/OutOfMemoryError"
 
#define PK11_EXCEPTION "org/mozilla/jss/pkcs11/PK11Exception"
 
#define PQG_PARAM_GEN_EXCEPTION "org/mozilla/jss/crypto/PQGParamGenException"
 
#define SECURITY_EXCEPTION "java/lang/SecurityException"
 
#define SIGNATURE_EXCEPTION "java/security/SignatureException"
 
#define SOCKET_EXCEPTION "java/net/SocketException"
 
#define SSLSOCKET_EXCEPTION "org/mozilla/jss/ssl/SSLSocketException"
 
#define SOCKET_TIMEOUT_EXCEPTION "java/net/SocketTimeoutException"
 
#define TOKEN_EXCEPTION "org/mozilla/jss/crypto/TokenException"
 
#define TOKEN_NOT_INITIALIZED_EXCEPTION "org/mozilla/jss/pkcs11/PK11Token$NotInitializedException"
 
#define USER_CERT_CONFLICT_EXCEPTION "org/mozilla/jss/CryptoManager$UserCertConflictException"
 
</pre>
 
 
 
See also:
 
 
 
* https://github.com/dogtagpki/jss/blob/master/org/mozilla/jss/util/jss_exceptions.h
 
* https://github.com/dogtagpki/jss/blob/master/org/mozilla/jss/util/jssutil.h
 
* https://github.com/dogtagpki/jss/blob/master/org/mozilla/jss/util/jssutil.c
 
  
 
= References =
 
= References =

Revision as of 18:11, 29 July 2022

Native Code

Symbols

JSS symbols are defined in jss.def.

See also:

Utilities

  • JSS_PK11_getPrivKeyPtr(JNIEnv *env, jobject privkObject, SECKEYPrivateKey** ptr)
  • JSS_PK11_getPubKeyPtr(JNIEnv *env, jobject pubkObject, SECKEYPublicKey** ptr)
  • jobject JSS_PK11_wrapPrivKey(JNIEnv *env, SECKEYPrivateKey **privk)
  • jobject JSS_PK11_wrapPubKey(JNIEnv *env, SECKEYPublicKey **pKey)

CryptoManager

See CryptoManager.

CryptoToken

See CryptoToken.

CryptoStore

See JSS CryptoStore.

OCSP Configuration

See JSS OCSP API.

Certificates

See JSS Certificate API.

SSL

See JSS SSL API.

PKCS #11

Exceptions

See Exceptions.

References