public InsertableClientSSK getInsertableSSK(String string) { try { return new InsertableClientSSK(string, pubKeyHash, new DSAPublicKey(getCryptoGroup(), privKey), privKey, cryptoKey, cryptoAlgorithm); } catch (MalformedURLException e) { Logger.error(this, "Caught "+e+" should not be possible in USK.getSSK", e); throw new Error(e); } }
public static InsertableClientSSK createRandom(RandomSource r, String docName) { byte[] ckey = new byte[CRYPTO_KEY_LENGTH]; r.nextBytes(ckey); DSAGroup g = Global.DSAgroupBigA; DSAPrivateKey privKey = new DSAPrivateKey(g, r); DSAPublicKey pubKey = new DSAPublicKey(g, privKey); try { byte[] pkHash = SHA256.digest(pubKey.asBytes()); return new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256); } catch (MalformedURLException e) { throw new Error(e); } }
return new InsertableClientSSK(uri.getDocName(), pkHash, pubKey, privKey, uri.getCryptoKey(), keyType);
byte[] pkHash = SHA256.digest(pubKey.asBytes()); String docName = "myDOC"; InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);
byte[] pkHash = SHA256.digest(pubKey.asBytes()); String docName = "myDOC"; InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);
byte[] pkHash = SHA256.digest(pubKey.asBytes()); String docName = "myDOC"; InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);
byte[] pkHash = SHA256.digest(pubKey.asBytes()); String docName = "myDOC"; InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256); DSAPublicKey pubKey2 = new DSAPublicKey(g, privKey2); byte[] pkHash2 = SHA256.digest(pubKey2.asBytes()); InsertableClientSSK ik2 = new InsertableClientSSK(docName, pkHash2, pubKey2, privKey2, ckey, Key.ALGO_AES_PCFB_256_SHA256); block = ik2.encode(bucket, false, false, (short)-1, bucket.size(), random, Compressor.DEFAULT_COMPRESSORDESCRIPTOR, false); SSKBlock sskBlock2 = (SSKBlock) block.getBlock();
byte[] pkHash = SHA256.digest(pubKey.asBytes()); String docName = "myDOC"; InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);