/** @param file the file path to persist the registry */ public SecurityRegistryImpl(String file, PrivateKey serverPrivateKey, PublicKey serverPublicKey) { Validate.notEmpty(file); filename = file; this.serverPrivateKey = serverPrivateKey; this.serverPublicKey = serverPublicKey; loadFromFile(); }
/** @param file the file path to persist the registry */ public SecurityRegistryImpl( String file, PrivateKey serverPrivateKey, X509Certificate[] serverX509CertChain, Certificate[] trustedCertificates) { Validate.notEmpty(file); Validate.notEmpty(serverX509CertChain); Validate.notEmpty(trustedCertificates); filename = file; this.serverPrivateKey = serverPrivateKey; this.serverX509CertChain = serverX509CertChain; // extract the raw public key from the first certificate in the chain this.serverPublicKey = serverX509CertChain[0].getPublicKey(); this.trustedCertificates = trustedCertificates; loadFromFile(); }