getDerEncodedNamedCurve

Synopsis

getDerEncodedNamedCurve <pszCurveName>

Description

Access curve OIDs from the Cryptoki library. Previous JCPROV versions require explicitly coded elliptic curve OIDs in java code. The JCPROV enhancement allows Java to get curve OIDs from the Cryptoki library.

To get curve OIDs from the Cryptoki library

To use JCPROV to get curve OIDs from the Cryptoki Library include the following syntax in the Java code:

{
	LongRef oidBufLen = new LongRef();
 
	CTUtilEx.CTU_DerEncodeNamedCurve(pszCurveName.getBytes(),
			null, oidBufLen);
	//System.out.println("oidBufLen=" + (int)oidBufLen.value);
	byte[] oidBuf = new byte[(int)oidBufLen.value];
	CTUtilEx.CTU_DerEncodeNamedCurve(pszCurveName.getBytes(),
			oidBuf, oidBufLen);
	//System.out.println("oidBufLen=" + (int)oidBufLen.value);
	return oidBuf;
}
 

...where the pszCurveName variable may be assigned to P-192, ..., brainpoolP512t1 values.