Package net.i2p.data
Class BlindData
java.lang.Object
net.i2p.data.BlindData
public class BlindData extends Object
Cache data for Blinding EdDSA keys.
PRELIMINARY - Subject to change - see proposal 123
- Since:
- 0.9.40
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BlindData(I2PAppContext ctx, Destination dest, SigType blindType, String secret)
BlindData(I2PAppContext ctx, Destination dest, SigType blindType, String secret, int authType, PrivateKey authKey)
BlindData(I2PAppContext ctx, SigningPublicKey spk, SigType blindType, String secret)
BlindData(I2PAppContext ctx, SigningPublicKey spk, SigType blindType, String secret, int authType, PrivateKey authKey)
-
Method Summary
Modifier and Type Method Description SigningPrivateKey
getAlpha()
PrivateKey
getAuthPrivKey()
boolean
getAuthRequired()
int
getAuthType()
Hash
getBlindedHash()
SigningPublicKey
getBlindedPubKey()
SigType
getBlindedSigType()
long
getDate()
Creation date.Hash
getDestHash()
Destination
getDestination()
long
getExpiration()
Expiration date.String
getSecret()
boolean
getSecretRequired()
SigningPublicKey
getUnblindedPubKey()
void
setAuthRequired()
void
setDate(long date)
Creation date.void
setDestination(Destination d)
void
setExpiration(long date)
Expiration date.void
setSecretRequired()
String
toBase32()
b33 formatString
toString()
-
Field Details
-
AUTH_NONE
public static final int AUTH_NONEbits 3-0 including per-client bit- Since:
- 0.9.41
- See Also:
- Constant Field Values
-
AUTH_DH
public static final int AUTH_DHbits 3-0 including per-client bit- Since:
- 0.9.41
- See Also:
- Constant Field Values
-
AUTH_PSK
public static final int AUTH_PSKbits 3-0 including per-client bit- Since:
- 0.9.41
- See Also:
- Constant Field Values
-
AUTH_ON
public static final int AUTH_ONEnabled, unspecified type- Since:
- 0.9.41
- See Also:
- Constant Field Values
-
-
Constructor Details
-
BlindData
- Parameters:
secret
- may be null or zero-length- Throws:
IllegalArgumentException
- on various errors
-
BlindData
public BlindData(I2PAppContext ctx, Destination dest, SigType blindType, String secret, int authType, PrivateKey authKey)- Parameters:
secret
- may be null or zero-length- Throws:
IllegalArgumentException
- on various errors- Since:
- 0.9.41
-
BlindData
- Parameters:
secret
- may be null or zero-length- Throws:
IllegalArgumentException
- on various errors
-
BlindData
public BlindData(I2PAppContext ctx, SigningPublicKey spk, SigType blindType, String secret, int authType, PrivateKey authKey)- Parameters:
secret
- may be null or zero-length- Throws:
IllegalArgumentException
- on various errors- Since:
- 0.9.41
-
-
Method Details
-
getUnblindedPubKey
- Returns:
- The unblinded SPK, non-null
-
getBlindedSigType
- Returns:
- The type of the blinded key
-
getBlindedPubKey
- Returns:
- The blinded key for the current day, non-null
-
getDestHash
- Returns:
- The hash of the destination if known, or null
-
getBlindedHash
- Returns:
- The hash of the blinded key for the current day
-
getAlpha
- Returns:
- Alpha for the current day
-
getDestination
- Returns:
- null if unknown
-
setDestination
- Throws:
IllegalArgumentException
- on SigningPublicKey mismatch
-
getSecret
- Returns:
- null if none
-
getAuthType
public int getAuthType()- Returns:
- 0 for no client auth, 1 for DH, 3 for PSK
-
getAuthPrivKey
- Returns:
- null for no client auth
-
toBase32
b33 format- Since:
- 0.9.41
-
setSecretRequired
public void setSecretRequired()- Since:
- 0.9.41
-
getSecretRequired
public boolean getSecretRequired()- Since:
- 0.9.41
-
setAuthRequired
public void setAuthRequired()- Since:
- 0.9.41
-
getAuthRequired
public boolean getAuthRequired()- Since:
- 0.9.41
-
setDate
public void setDate(long date)Creation date. Absolute timestamp.- Since:
- 0.9.41
-
getDate
public long getDate()Creation date. Absolute timestamp. Returns zero if not specified.- Returns:
- creation date or as overridden by setDate()
- Since:
- 0.9.41
-
setExpiration
public void setExpiration(long date)Expiration date. Absolute timestamp.- Since:
- 0.9.43
-
getExpiration
public long getExpiration()Expiration date. Absolute timestamp. Returns zero if not specified.- Returns:
- expiration date or as overridden by setExpiration()
- Since:
- 0.9.43
-
toString
-