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

com.virgilsecurity.crypto.VirgilBase64 Maven / Gradle / Ivy

Go to download

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. Learn about Virgil Crypto Library https://virgilsecurity.com/api-docs/java-android/crypto-library

There is a newer version: 7.3.2
Show newest version
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.virgilsecurity.crypto;

public class VirgilBase64 implements java.lang.AutoCloseable {
	private long swigCPtr;
	protected boolean swigCMemOwn;

	protected VirgilBase64(long cPtr, boolean cMemoryOwn) {
		swigCMemOwn = cMemoryOwn;
		swigCPtr = cPtr;
	}

	protected static long getCPtr(VirgilBase64 obj) {
		return (obj == null) ? 0 : obj.swigCPtr;
	}

	protected void finalize() {
		delete();
	}

	public synchronized void delete() {
		if (swigCPtr != 0) {
			if (swigCMemOwn) {
				swigCMemOwn = false;
				virgil_crypto_javaJNI.delete_VirgilBase64(swigCPtr);
			}
			swigCPtr = 0;
		}
	}

	@Override
	public void close() {
		delete();
	}

	public static String encode(byte[] data) {
		return virgil_crypto_javaJNI.VirgilBase64_encode(data);
	}

	public static byte[] decode(String base64str) {
		return virgil_crypto_javaJNI.VirgilBase64_decode(base64str);
	}

	public VirgilBase64() {
		this(virgil_crypto_javaJNI.new_VirgilBase64(), true);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy