Code example for MalformedURLException

0
	} 
	 
	public ClientSSK(FreenetURI origURI) throws MalformedURLException {
		this(origURI.getDocName(), origURI.getRoutingKey(), origURI.getExtra(), null, origURI.getCryptoKey());
		if(!origURI.getKeyType().equalsIgnoreCase("SSK"))
			throw new MalformedURLException();
	} 
	 
	public synchronized void setPublicKey(DSAPublicKey pubKey) {
		if((this.pubKey != null) && (this.pubKey != pubKey) && !this.pubKey.equals(pubKey))
			throw new IllegalArgumentException("Cannot reassign: was "+this.pubKey+" now "+pubKey);
		byte[] newKeyHash = pubKey.asBytesHash();
		if(!Arrays.equals(newKeyHash, pubKeyHash))
			throw new IllegalArgumentException("New pubKey hash does not match pubKeyHash: "+HexUtil.bytesToHex(newKeyHash)+" ( "+HexUtil.bytesToHex(pubKey.asBytesHash())+" != "+HexUtil.bytesToHex(pubKeyHash)+" for "+pubKey);
		this.pubKey = pubKey;
		this.cachedNodeKey = null;
	} 
	 
	@Override 
	public FreenetURI getURI() { 
		return new FreenetURI("SSK", docName, pubKeyHash, cryptoKey, getExtraBytes());