Tabnine Logo
PemBlock.getString
Code IndexAdd Tabnine to your IDE (free)

How to use
getString
method
in
de.mhus.lib.core.crypt.pem.PemBlock

Best Java code snippets using de.mhus.lib.core.crypt.pem.PemBlock.getString (Showing top 10 results out of 315)

origin: de.mhus.osgi/mhu-osgi-crypt-api

@Override
public void foundPublicKey(PemBlock block) {
  String id = block.getString(PemBlock.IDENT, null);
  if (id == null) return;
  keys.put(id, block);
}
origin: de.mhus.osgi/mhu-osgi-crypt-api

@Override
public void foundPrivateKey(PemBlock block) {
  String id = block.getString(PemBlock.IDENT, null);
  if (id == null) return;
  keys.put(id, block);
}
origin: de.mhus.osgi/mhu-osgi-crypt-api

@Override
public String getPrivateIdForPublicKeyId(String pubId) throws CryptException {
  PemBlock pub = keys.get(pubId);
  if (pub == null) return null;
  return pub.getString(PemBlock.PRIV_ID, null);
}
origin: de.mhus.lib/mhu-lib-core

public static String toLine(PemBlock key) {
  return key.getString(PemBlock.METHOD, "?") + ":" + key.getBlock();
}
origin: de.mhus.osgi/mhu-osgi-crypt-bc

@Override
public String decrypt(PemPriv key, PemBlock encoded, String passphrase) throws MException {
  try {
    byte[] xkey = key.getBytesBlock();
    byte[] data = encoded.getBytesBlock();
    Cipher c = Cipher.getInstance("AES");
    SecretKeySpec k = new SecretKeySpec(xkey, "AES");
    c.init(Cipher.DECRYPT_MODE, k);
    byte[] enc = c.doFinal(data);
    
    String stringEncoding = encoded.getString(PemBlock.STRING_ENCODING, "utf-8");
    return new String(enc, stringEncoding);
    
  } catch (Throwable t) {
    throw new MException(t);
  }
}
origin: de.mhus.lib/mhu-lib-core

public PemEntry(PemBlock block)  {
    String str = block.getString(PemBlock.IDENT, null);
    if (str == null)
      id = UUID.randomUUID();
    description = block.getString(PemBlock.DESCRIPTION, "");
    String method = block.getString(PemBlock.METHOD, "").toUpperCase();
    if (PemUtil.isPubKey(block)) {
      if (method.contains("RSA"))
origin: de.mhus.osgi/mhu-osgi-crypt-bc

cipher.init(Cipher.DECRYPT_MODE, privKey);
String aesEncKey = encoded.getString("AesKey");
byte[] b = Base64.decode(aesEncKey);
byte[] enc = c.doFinal(data);
String stringEncoding = encoded.getString(PemBlock.STRING_ENCODING, "utf-8");
return new String(enc, stringEncoding);
origin: de.mhus.osgi/mhu-osgi-crypt-bc

cipher.init(Cipher.DECRYPT_MODE, privKey);
String aesEncKey = encoded.getString("AesKey");
byte[] b = Base64.decode(aesEncKey);
byte[] enc = c.doFinal(data);
String stringEncoding = encoded.getString(PemBlock.STRING_ENCODING, "utf-8");
return new String(enc, stringEncoding);
origin: de.mhus.osgi/mhu-osgi-crypt-bc

String stringEncoding = encoded.getString(PemBlock.STRING_ENCODING, "utf-8");
return new String(os.toByteArray(), stringEncoding);
origin: de.mhus.osgi/mhu-osgi-crypt-bc

String stringEncoding = encoded.getString(PemBlock.STRING_ENCODING, "utf-8");
return new String(os.toByteArray(), stringEncoding);
de.mhus.lib.core.crypt.pemPemBlockgetString

Popular methods of PemBlock

  • entrySet
  • getBlock
    Returns the Block content without placeholders.
  • getBytesBlock
  • getName
    Returns the name of the block

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Permission (java.security)
    Legacy security code; do not use.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
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