requireSupportedVersion
fn
void requireSupportedVersion(const(ubyte)[] versionBytes, string what) pure @safeValidates a decoded key-structure version field.
Key containers such as PKCS#8 PrivateKeyInfo and PKCS#1 RSAPrivateKey start with a version INTEGER; only version zero (v1 / two-prime) is supported here. Silently accepting a higher version would reinterpret a structure with extra or different fields (multi-prime RSA, public-key-bearing PKCS#8) as the plain one.
Parameters
versionBytes | The raw INTEGER content bytes read from the structure. |
what | A human-readable name of the structure for error messages. |
Throws
CryptoException when the version is anything but zero.