public static final void validate(Key key) throws InvalidKeyException {
  if (key == null) {
    throw new NullPointerException("The key to be validated cannot be null");
  }
  if (key instanceof DHPublicKey) {
    validateDHPublicKey((DHPublicKey)key);
  }
}

public static final void validate ( Key key ) throws InvalidKeyException { if ( key == null ) { throw new NullPointerException ( "The key to be validated cannot be null" ) ; } if ( key instanceof DHPublicKey ) { validateDHPublicKey ( ( DHPublicKey ) key ) ; } }
returns whether the key is valid or not . < p > note that this method is only apply to dhpublickey at present .
