congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OperatorUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
OperatorUtils
in
org.spongycastle.operator.jcajce

Best Java code snippets using org.spongycastle.operator.jcajce.OperatorUtils (Showing top 6 results out of 315)

origin: com.madgag.spongycastle/pkix

public byte[] generateWrappedKey(GenericKey encryptionKey)
  throws OperatorException
{
  Key contentEncryptionKeySpec = OperatorUtils.getJceKey(encryptionKey);
  Cipher keyEncryptionCipher = helper.createSymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm());
  try
  {
    keyEncryptionCipher.init(Cipher.WRAP_MODE, wrappingKey, random);
    return keyEncryptionCipher.wrap(contentEncryptionKeySpec);
  }
  catch (GeneralSecurityException e)
  {
    throw new OperatorException("cannot wrap key: " + e.getMessage(), e);
  }
}
origin: com.madgag.spongycastle/bcpkix-jdk15on

public byte[] generateWrappedKey(GenericKey encryptionKey)
  throws OperatorException
{
  Key contentEncryptionKeySpec = OperatorUtils.getJceKey(encryptionKey);
  Cipher keyEncryptionCipher = helper.createSymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm());
  try
  {
    keyEncryptionCipher.init(Cipher.WRAP_MODE, wrappingKey, random);
    return keyEncryptionCipher.wrap(contentEncryptionKeySpec);
  }
  catch (GeneralSecurityException e)
  {
    throw new OperatorException("cannot wrap key: " + e.getMessage(), e);
  }
}
origin: com.madgag.spongycastle/bcpkix-jdk15on

encryptedKeyBytes = keyEncryptionCipher.wrap(OperatorUtils.getJceKey(encryptionKey));
  encryptedKeyBytes = keyEncryptionCipher.doFinal(OperatorUtils.getJceKey(encryptionKey).getEncoded());
origin: com.madgag.spongycastle/pkix

encryptedKeyBytes = keyEncryptionCipher.wrap(OperatorUtils.getJceKey(encryptionKey));
  encryptedKeyBytes = keyEncryptionCipher.doFinal(OperatorUtils.getJceKey(encryptionKey).getEncoded());
origin: com.madgag.spongycastle/pkix

  public byte[] generateWrappedKey(GenericKey encryptionKey)
    throws OperatorException
  {
    Cipher keyEncryptionCipher = helper.createAsymmetricWrapper(getAlgorithmIdentifier().getAlgorithm(), new HashMap());

    try
    {
      DEROtherInfo otherInfo = new DEROtherInfo.Builder(JceSymmetricKeyWrapper.determineKeyEncAlg(symmetricWrappingAlg, keySizeInBits), partyUInfo, partyVInfo).build();
      KTSParameterSpec ktsSpec = new KTSParameterSpec.Builder(symmetricWrappingAlg, keySizeInBits, otherInfo.getEncoded()).build();

      keyEncryptionCipher.init(Cipher.WRAP_MODE, publicKey, ktsSpec, random);

      return keyEncryptionCipher.wrap(OperatorUtils.getJceKey(encryptionKey));
    }
    catch (Exception e)
    {
      throw new OperatorException("Unable to wrap contents key: " + e.getMessage(), e);
    }
  }
}
origin: com.madgag.spongycastle/bcpkix-jdk15on

  public byte[] generateWrappedKey(GenericKey encryptionKey)
    throws OperatorException
  {
    Cipher keyEncryptionCipher = helper.createAsymmetricWrapper(getAlgorithmIdentifier().getAlgorithm(), new HashMap());

    try
    {
      DEROtherInfo otherInfo = new DEROtherInfo.Builder(JceSymmetricKeyWrapper.determineKeyEncAlg(symmetricWrappingAlg, keySizeInBits), partyUInfo, partyVInfo).build();
      KTSParameterSpec ktsSpec = new KTSParameterSpec.Builder(symmetricWrappingAlg, keySizeInBits, otherInfo.getEncoded()).build();

      keyEncryptionCipher.init(Cipher.WRAP_MODE, publicKey, ktsSpec, random);

      return keyEncryptionCipher.wrap(OperatorUtils.getJceKey(encryptionKey));
    }
    catch (Exception e)
    {
      throw new OperatorException("Unable to wrap contents key: " + e.getMessage(), e);
    }
  }
}
org.spongycastle.operator.jcajceOperatorUtils

Most used methods

  • getJceKey

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JPanel (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now