Class Pk8OrPemKeyManager

java.lang.Object
org.postgresql.ssl.Pk8OrPemKeyManager
All Implemented Interfaces:
KeyManager, X509KeyManager

public class Pk8OrPemKeyManager extends Object implements X509KeyManager
A key manager that selects PEM when its header is found within the first 64 KiB of the key file, and PK8/DER otherwise. This preserves libpq's preference for PEM before DER, while using a bounded marker scan rather than parsing the key during format detection.

The delegate is resolved lazily on the first call to any X509KeyManager method, so this works regardless of which method the TLS engine calls first.