public USK(byte[] pubKeyHash, byte[] cryptoKey, byte[] extra, String siteName, long suggestedEdition) throws MalformedURLException {
this.pubKeyHash = pubKeyHash;
this.cryptoKey = cryptoKey;
this.siteName = siteName;
this.suggestedEdition = suggestedEdition;
if(extra == null)
throw new MalformedURLException("No extra bytes (third bit) in USK");
if(pubKeyHash == null)
throw new MalformedURLException("No pubkey hash (first bit) in USK");
if(cryptoKey == null)
throw new MalformedURLException("No crypto key (second bit) in USK");
ClientSSK tmp = new ClientSSK(siteName, pubKeyHash, extra, null, cryptoKey);
cryptoAlgorithm = tmp.cryptoAlgorithm;
if(pubKeyHash.length != NodeSSK.PUBKEY_HASH_SIZE)
throw new MalformedURLException("Pubkey hash wrong length: "+pubKeyHash.length+" should be "+NodeSSK.PUBKEY_HASH_SIZE);
if(cryptoKey.length != ClientSSK.CRYPTO_KEY_LENGTH)
throw new MalformedURLException("Decryption key wrong length: "+cryptoKey.length+" should be "+ClientSSK.CRYPTO_KEY_LENGTH);
hashCode = Fields.hashCode(pubKeyHash) ^ Fields.hashCode(cryptoKey) ^
siteName.hashCode() ^ (int)suggestedEdition ^ (int)(suggestedEdition >> 32);
}