package com.subgraph.orchid.circuits.hs;

import com.subgraph.orchid.crypto.TorPublicKey;
import com.subgraph.orchid.data.HexDigest;
import com.subgraph.orchid.data.Timestamp;

public class HSDescriptor {
	private HexDigest descriptorId;
	private Timestamp publicationTime;
	private HexDigest secretIdPart;
	private TorPublicKey permanentKey;
	private int[] protocolVersions;
	
	void setPublicationTime(Timestamp ts) {
		this.publicationTime = ts;
	}
	
	void setSecretIdPart(HexDigest secretIdPart) {
		this.secretIdPart = secretIdPart;
	}
	
	void setDescriptorId(HexDigest descriptorId) {
		this.descriptorId = descriptorId;
	}
	
	void setPermanentKey(TorPublicKey permanentKey) {
		this.permanentKey = permanentKey;
	}
	
	void setProtocolVersions(int[] protocolVersions) {
		this.protocolVersions = protocolVersions;
	}
	
	HexDigest getDescriptorId() {
		return descriptorId;
	}
	
	int getVersion() {
		return 2;
	}
	
	TorPublicKey getPermanentKey() {
		return permanentKey;
	}
	
	HexDigest getSecretIdPart() {
		return secretIdPart;
	}
	
	Timestamp getPublicationTime() {
		return publicationTime;
	}
	
	int[] getProtocolVersions() {
		return protocolVersions;
	}
}

@@ -37,16 +37,71 @@
 .hs;%0D%0A%0D%0A
+import java.util.ArrayList;%0D%0Aimport java.util.List;%0D%0A%0D%0A
 import c
@@ -141,16 +141,16 @@
 icKey;%0D%0A
-
 import c
@@ -436,16 +436,163 @@
 sions;%0D%0A
+%09private List%3CIntroductionPoint%3E introductionPoints;%0D%0A%09%0D%0A%09public HSDescriptor() %7B%0D%0A%09%09introductionPoints = new ArrayList%3CIntroductionPoint%3E();%0D%0A%09%7D%0D%0A
 %09%0D%0A%09void
@@ -1045,25 +1045,113 @@
 sions;%0D%0A%09%7D%0D%0A
-%09
+%0D%0A%09void addIntroductionPoint(IntroductionPoint ip) %7B%0D%0A%09%09introductionPoints.add(ip);%0D%0A%09%7D%0D%0A
 %0D%0A%09HexDigest
@@ -1502,15 +1502,20 @@
 sions;%0D%0A
-
 %09%7D%0D%0A
+%09%0D%0A%0D%0A
 %7D%0D%0A

Store introduction points in descriptor