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

common.crypto.RSA Maven / Gradle / Ivy

Go to download

This is a collection of JAVA libraries that implement Unbound cryptographic classes for JAVA provider, PKCS11 wrapper, cryptoki, and advapi

There is a newer version: 42761
Show newest version
package com.unbound.common.crypto;

import java.security.Signature;
import java.security.interfaces.RSAPrivateKey;

public final class RSA
{
  public static byte[] signPkcs1(RSAPrivateKey key, String hashType, byte[] in)
  {
    try
    {
      Signature signature = SystemProvider.Signature.getInstance(hashType + "withRSA");
      signature.initSign(key);
      signature.update(in);
      return signature.sign();
    }
    catch (Exception e) { throw new IllegalArgumentException(e); }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy