func (client *clientImpl) loadTCertOwnerKDFKey(pwd []byte) error { // Load TCertOwnerKDFKey client.node.log.Debug("Loading TCertOwnerKDFKey at [%s]...", client.node.conf.getTCertOwnerKDFKeyPath()) missing, _ := utils.FilePathMissing(client.node.conf.getTCertOwnerKDFKeyPath()) if missing { client.node.log.Debug("Failed loading TCertOwnerKDFKey. File is missing.") return nil } pem, err := ioutil.ReadFile(client.node.conf.getTCertOwnerKDFKeyPath()) if err != nil { client.node.log.Error("Failed loading TCertOwnerKDFKey [%s].", err.Error()) return err } tCertOwnerKDFKey, err := utils.PEMtoAES(pem, pwd) if err != nil { client.node.log.Error("Failed parsing TCertOwnerKDFKey [%s].", err.Error()) return err } client.tCertOwnerKDFKey = tCertOwnerKDFKey client.node.log.Debug("Loading TCertOwnerKDFKey...done!") return nil }
func (ks *keyStore) isAliasSet(alias string) bool { missing, _ := utils.FilePathMissing(ks.conf.getPathForAlias(alias)) if missing { return false } return true }