Properly handle PKI