mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-20 17:33:08 +00:00
Add Subscriber constructor
This commit is contained in:
parent
30167ce4ed
commit
8ee7245881
@ -18,8 +18,10 @@ public class SigningKey extends AbstractId {
|
||||
super(binary);
|
||||
}
|
||||
|
||||
public static final int BINARY_SIZE = 32;
|
||||
|
||||
@Override
|
||||
int getBinarySize() {
|
||||
return 32;
|
||||
public int getBinarySize() {
|
||||
return BINARY_SIZE;
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,12 @@ public final class Subscriber {
|
||||
this.combined = combined;
|
||||
}
|
||||
|
||||
public Subscriber(byte[] sidBytes, byte[] signBytes, boolean combined) throws AbstractId.InvalidBinaryException {
|
||||
sid = new SubscriberId(sidBytes);
|
||||
signingKey = signBytes==null ? null : new SigningKey(signBytes);
|
||||
this.combined = combined;
|
||||
}
|
||||
|
||||
public Subscriber(ByteBuffer buff) throws AbstractId.InvalidBinaryException {
|
||||
SubscriberId sid = new SubscriberId(buff);
|
||||
SigningKey signingKey = new SigningKey(buff);
|
||||
|
Loading…
x
Reference in New Issue
Block a user