/** * Asynchronously create a signature for a specific identity * * @param {long} duration Length of time in milliseconds to authorize * control. * @param {String} server Server that we are authorizing. * @param {EcPpk} ppk Key of the identity to create a signature for * @param success Callback triggered once the signature sheet has been * created, returns the signature * @memberOf EcIdentityManager * @method createSignatureAsync * @static */ private static void createSignatureAsync(long duration, String server, EcPpk ppk, final Callback1<EbacSignature> success, final Callback1<String> failure) { final EbacSignature s = new EbacSignature(); s.owner = ppk.toPk().toPem(); s.expiry = new Date().getTime() + duration; s.server = server; EcRsaOaepAsync.sign(ppk, s.toJson(), new Callback1<String>() { @Override public void $invoke(String p1) { s.signature = p1; success.$invoke(s); } }, failure); }