pubKeyHash = SHA256.digest(pubKey.asBytes());
pubKeyHashHash = SHA256.digest(pubKeyHash);
ecdsaSFS = fs.subset("ecdsa");
if(ecdsaSFS != null) {
ecdsaP256 = new ECDSA(ecdsaSFS.subset(ECDSA.Curves.P256.name()), Curves.P256);
}
} catch (IllegalBase64Exception e) {
Logger.error(this, "Caught "+e, e);
throw new IOException(e.toString());
} catch (FSParseException e) {
Logger.error(this, "Caught "+e, e);
throw new IOException(e.toString());
} catch (IllegalArgumentException e) {
// DSAPrivateKey is invalid
Logger.error(this, "Caught "+e, e);
throw new IOException(e.toString());
}
if(ecdsaP256 == null) {
// We don't have a keypair, generate one.
Logger.normal(this, "No ecdsa.P256 field found in noderef: let's generate a new key");
ecdsaP256 = new ECDSA(Curves.P256);
}
ecdsaPubKeyHash = SHA256.digest(ecdsaP256.getPublicKey().getEncoded());
InsertableClientSSK ark = null;