			throw new ForbiddenException("It is not allowed to download the private key");
		}

		RSAPrivateKey key = signatureService.getKey();
		return key == null ? new byte[0] : key.getEncoded();
	}

	@Override
	public void setEncodedKey(byte[] key) throws IOException {
		if (!allowUploadPrivateKey) {
			throw new ForbiddenException("It is not allowed to upload a private key");
		}

		try {
			signatureService.setKey(key.length == 0 ? null : KeyUtils.fromPKCS8(key));