public static DHPublicKey getInstance(Object obj) { if (obj == null || obj instanceof DHPublicKey) { return (DHPublicKey)obj; } if (obj instanceof ASN1Integer) { return new DHPublicKey((ASN1Integer)obj); } throw new IllegalArgumentException("Invalid DHPublicKey: " + obj.getClass().getName()); }
/** * Return a DHPublicKey from the passed in tagged object. * * @param obj a tagged object. * @param explicit true if the contents of the object is explictly tagged, false otherwise. * @return a DHPublicKey */ public static DHPublicKey getInstance(ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Integer.getInstance(obj, explicit)); }
DHPublicKey dhPublicKey = DHPublicKey.getInstance(keyInfo.parsePublicKey()); BigInteger y = dhPublicKey.getY();
DHPublicKey dhPublicKey = DHPublicKey.getInstance(keyInfo.parsePublicKey()); BigInteger y = dhPublicKey.getY().getValue();
public static DHPublicKey getInstance(ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Integer.getInstance(obj, explicit)); }
/** * Return a DHPublicKey from the passed in object. * * @param obj an object for conversion or a byte[]. * @return a DHPublicKey */ public static DHPublicKey getInstance(Object obj) { if (obj == null || obj instanceof DHPublicKey) { return (DHPublicKey)obj; } if (obj instanceof ASN1Integer) { return new DHPublicKey((ASN1Integer)obj); } throw new IllegalArgumentException("Invalid DHPublicKey: " + obj.getClass().getName()); }