code: 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);
          }
      }
docs: Returns whether the key is valid or not.
  <P>
  Note that this method is only apply to DHPublicKey at present.
  
  @param  publicKey
  the key object, cannot be null
  
  @throws NullPointerException if {@code publicKey} is null
  @throws InvalidKeyException if {@code publicKey} is invalid