public EncryptedBallot(Value encryptedBallot) throws InvalidVoteException {
		// Checks whether the value object has the required fields.
		if(!encryptedBallot.hasChildren(ValueIdentifiers.getUserId()) ||
			!encryptedBallot.hasChildren(ValueIdentifiers.getSid()) ||
			!encryptedBallot.hasChildren(ValueIdentifiers.getVote())) {
			throw new BadValueException();
		}
		this.userId = encryptedBallot.getFirstChild(ValueIdentifiers.getUserId()).byteArrayValue().getBytes();
		this.sid = encryptedBallot.getFirstChild(ValueIdentifiers.getSid()).strValue();
		
		ValueVector valueVote = encryptedBallot.getChildren(ValueIdentifiers.getVote());
		vote = new byte[valueVote.size()][];
		int i = 0;
		for(Value v : valueVote) {
			vote[i] = v.byteArrayValue().getBytes();
			i++;
		}
		this.signature = encryptedBallot.getFirstChild(ValueIdentifiers.getSignature()).byteArrayValue().getBytes();
	}