Tabnine Logo
EcPpk.toPem
Code IndexAdd Tabnine to your IDE (free)

How to use
toPem
method
in
com.eduworks.ec.crypto.EcPpk

Best Java code snippets using com.eduworks.ec.crypto.EcPpk.toPem (Showing top 5 results out of 315)

origin: com.eduworks/ebac.identity

@Override
public boolean equals(Object obj) {
  if (obj instanceof EcIdentity) {
    if (ppk == null)
      return false;
    if (((EcIdentity) obj).ppk == null)
      return false;
    return ppk.toPem().equals(((EcIdentity) obj).ppk.toPem());
  }
  return super.equals(obj);
}
origin: com.eduworks/ebac.identity

/**
 * Helper function to encrypt an identity into a credential (storable
 * version of an identity)
 *
 * @param {String} secret
 *                 AES secret used to encrypt the credential.
 * @return {EbacCredential}
 * Encrypted credential object.
 * @memberOf EcIdentity
 * @method toCredential
 */
public EbacCredential toCredential(String secret) {
  EbacCredential c = new EbacCredential();
  c.iv = EcAes.newIv(16);
  c.ppk = EcAesCtr.encrypt(ppk.toPem(), secret, c.iv);
  c.displayNameIv = EcAes.newIv(16);
  c.displayName = EcAesCtr.encrypt(displayName, secret, c.iv);
  return c;
}
origin: com.eduworks/ebac.identity

/**
 * Writes contact data to localstorage.
 *
 * @memberOf EcIdentityManager
 * @method saveIdentities
 * @static
 */
public static void saveIdentities() {
  Array<Object> c = new Array<Object>();
  for (int i = 0; i < ids.$length(); i++) {
    Object o = new Object();
    Map<String, Object> props = JSObjectAdapter.$properties(o);
    EcIdentity identity = ids.$get(i);
    props.$put("displayName", identity.displayName);
    props.$put("ppk", identity.ppk.toPem());
    props.$put("source", identity.source);
    c.push(o);
  }
  Global.localStorage.$put("identities", JSGlobal.JSON.stringify(c));
}
origin: com.eduworks/ebac.identity

private void writeIdentityFile(String folderId, final EcIdentity identity, final Callback0 finished) {
  File file = BlobHelper.stringToFile(identity.ppk.toPem(), identity.displayName + ".pem", "text/plain");
  Object o = new Object();
  JSObjectAdapter.$put(o, "id", JSObjectAdapter.$get(identity, "id"));
  if (JSObjectAdapter.$get(o, "id") == Global.undefined)
    JSObjectAdapter.$put(o, "parent", folderId);
  JSObjectAdapter.$put(o, "name", file.name);
  Array<File> files = new Array<>();
  files.push(file);
  JSObjectAdapter.$put(o, "file", files);
  hello.api(network + "/" + "me/files", JSObjectAdapter.$get(identity, "id") == Global.undefined ? "post" : "put", o).then(new Callback1<Object>() {
    @Override
    public void $invoke(Object r) {
      JSObjectAdapter.$put(identity, "id", JSObjectAdapter.$get(r, "id"));
      if (finished != null)
        finished.$invoke();
    }
  });
}
origin: com.eduworks/ebac.identity

if (ids.$get(j).ppk.toPem() == identity.ppk.toPem()) {
  cont = true;
com.eduworks.ec.cryptoEcPpktoPem

Popular methods of EcPpk

  • toPk
  • equals
  • fromPem
  • inArray

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Permission (java.security)
    Legacy security code; do not use.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Best plugins for Eclipse
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