}
JCEDHPublicKey(
SubjectPublicKeyInfo info)
{
DHParameter params = new DHParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
DERInteger derY = null;
try
{
derY = (DERInteger)info.getPublicKey();
}
catch (IOException e)
{
throw new IllegalArgumentException("invalid info structure in DH public key");
}
this.y = derY.getValue();
if (params.getL() != null)
{
this.dhSpec = new DHParameterSpec(params.getP(), params.getG(), params.getL().intValue());
}
else
{
this.dhSpec = new DHParameterSpec(params.getP(), params.getG());
}
}