Code example for X509EncodedKeySpec

0
		} 
	} 
 
	public void setPublicKey(byte[] encoded) {
		if (encoded == null) return;
		final X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(encoded);
		if (type != null) {
			publicKey = decodePublicKeyAs(pubKeySpec, type);
		} else { 
			publicKey = decodePublicKeyAs(pubKeySpec, KEY_TYPE_RSA);
			if (publicKey != null) {
				type = KEY_TYPE_RSA;
			} else { 
				publicKey = decodePublicKeyAs(pubKeySpec, KEY_TYPE_DSA);
				if (publicKey != null) {
					type = KEY_TYPE_DSA;
				} 
			} 
		} 
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE