All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ironcorelabs.sdk.IronSdkAdvanced Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
// Automatically generated by rust_swig
package com.ironcorelabs.sdk;


public final class IronSdkAdvanced {

    private IronSdkAdvanced() {}
    /**
     * Encrypt the provided document bytes. Return the encrypted document encryption keys (EDEKs) instead of creating a document entry in the IronCore webservice.
     * 
     * @param documentData   bytes of the document to encrypt
     * @param encryptOpts    optional document encrypt parameters
     */
    public final DocumentEncryptUnmanagedResult documentEncryptUnmanaged(byte [] documentData, DocumentEncryptOpts encryptOpts) throws Exception {
        long a1 = encryptOpts.mNativeObj;
        long ret = do_documentEncryptUnmanaged(mNativeObj, documentData, a1);
        DocumentEncryptUnmanagedResult convRet = new DocumentEncryptUnmanagedResult(InternalPointerMarker.RAW_PTR, ret);

        JNIReachabilityFence.reachabilityFence1(encryptOpts);

        return convRet;
    }
    private static native long do_documentEncryptUnmanaged(long self, byte [] documentData, long encryptOpts) throws Exception;
    /**
     * Decrypt the provided encrypted document with the encrypted document encryption keys (EDEKs).
     * 
     * @param encryptedData bytes of encrypted document. Should be the same bytes returned from {@link #documentEncryptUnmanaged(byte[], DocumentEncryptOpts)}
     * @param encryptedDeks encrypted document encryption keys. Should be the same edeks returned from {@link #documentEncryptUnmanaged(byte[], DocumentEncryptOpts)}
     * 
     * @return {@link DocumentDecryptResult} includes the id of the provided document as well as the decrypted document bytes
     */
    public final DocumentDecryptUnmanagedResult documentDecryptUnmanaged(byte [] encryptedData, byte [] encryptedDeks) throws Exception {
        long ret = do_documentDecryptUnmanaged(mNativeObj, encryptedData, encryptedDeks);
        DocumentDecryptUnmanagedResult convRet = new DocumentDecryptUnmanagedResult(InternalPointerMarker.RAW_PTR, ret);

        return convRet;
    }
    private static native long do_documentDecryptUnmanaged(long self, byte [] encryptedData, byte [] encryptedDeks) throws Exception;

    public synchronized void delete() {
        if (mNativeObj != 0) {
            do_delete(mNativeObj);
            mNativeObj = 0;
       }
    }
    @Override
    protected void finalize() throws Throwable {
        try {
            delete();
        }
        finally {
             super.finalize();
        }
    }
    private static native void do_delete(long me);
    /*package*/ IronSdkAdvanced(InternalPointerMarker marker, long ptr) {
        assert marker == InternalPointerMarker.RAW_PTR;
        this.mNativeObj = ptr;
    }
    /*package*/ long mNativeObj;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy