public class BlindData extends Object
BlindData provides the infrastructure for cryptographic key blinding in I2P:
Key Components:
Authentication Types:
AUTH_NONE - No authentication requiredAUTH_DH - Diffie-Hellman key exchange for per-client keysAUTH_PSK - Pre-shared key authenticationUsage Scenarios:
Security Considerations:
Implementation Status: PRELIMINARY - Subject to change as proposal evolves
| Modifier and Type | Field and Description |
|---|---|
static int |
AUTH_DH
bits 3-0 including per-client bit
|
static int |
AUTH_NONE
bits 3-0 including per-client bit
|
static int |
AUTH_ON
Enabled, unspecified type
|
static int |
AUTH_PSK
bits 3-0 including per-client bit
|
| Constructor and Description |
|---|
BlindData(I2PAppContext ctx,
Destination dest,
SigType blindType,
String secret)
Creates a new BlindData instance for the given destination.
|
BlindData(I2PAppContext ctx,
Destination dest,
SigType blindType,
String secret,
int authType,
PrivateKey authKey)
Creates a new BlindData instance for the given destination with authentication.
|
BlindData(I2PAppContext ctx,
SigningPublicKey spk,
SigType blindType,
String secret) |
BlindData(I2PAppContext ctx,
SigningPublicKey spk,
SigType blindType,
String secret,
int authType,
PrivateKey authKey)
Creates a new BlindData instance for the given signing public key with authentication.
|
| Modifier and Type | Method and Description |
|---|---|
SigningPrivateKey |
getAlpha()
Gets the alpha value for the current day.
|
PrivateKey |
getAuthPrivKey()
Gets the authentication private key.
|
boolean |
getAuthRequired()
Checks if authentication is required.
|
int |
getAuthType()
Gets the authentication type.
|
Hash |
getBlindedHash()
Gets the hash of the blinded key for the current day.
|
SigningPublicKey |
getBlindedPubKey()
Gets the blinded signing public key for the current day.
|
SigType |
getBlindedSigType()
Gets the type of the blinded signature.
|
long |
getDate()
Creation date.
|
Hash |
getDestHash()
Gets the destination hash if known.
|
Destination |
getDestination()
Gets the destination if known.
|
long |
getExpiration()
Expiration date.
|
String |
getSecret()
Gets the secret if set.
|
boolean |
getSecretRequired()
Checks if a secret is required.
|
SigningPublicKey |
getUnblindedPubKey()
Gets the unblinded signing public key.
|
void |
setAuthRequired()
Marks that authentication is required for this blinded key.
|
void |
setDate(long date)
Creation date.
|
void |
setDestination(Destination d)
Sets the destination for this blinded data.
|
void |
setExpiration(long date)
Expiration date.
|
void |
setSecretRequired()
Marks that a secret is required for this blinded key.
|
String |
toBase32()
Encodes the blinded key in b33 format.
|
String |
toString() |
public static final int AUTH_DH
public static final int AUTH_NONE
public static final int AUTH_ON
public static final int AUTH_PSK
public BlindData(I2PAppContext ctx, Destination dest, SigType blindType, String secret)
ctx - the application contextdest - the destinationblindType - the type of blinded signaturesecret - may be null or zero-lengthIllegalArgumentException - on various errorspublic BlindData(I2PAppContext ctx, Destination dest, SigType blindType, String secret, int authType, PrivateKey authKey)
ctx - the application contextdest - the destinationblindType - the type of blinded signaturesecret - may be null or zero-lengthauthType - the authentication typeauthKey - the authentication keyIllegalArgumentException - on various errorspublic BlindData(I2PAppContext ctx, SigningPublicKey spk, SigType blindType, String secret)
secret - may be null or zero-lengthIllegalArgumentException - on various errorspublic BlindData(I2PAppContext ctx, SigningPublicKey spk, SigType blindType, String secret, int authType, PrivateKey authKey)
ctx - the application contextspk - the signing public keyblindType - the type of blinded signaturesecret - may be null or zero-lengthauthType - the authentication typeauthKey - the authentication keyIllegalArgumentException - on various errorspublic SigningPrivateKey getAlpha()
public PrivateKey getAuthPrivKey()
public boolean getAuthRequired()
public int getAuthType()
public Hash getBlindedHash()
public SigningPublicKey getBlindedPubKey()
public SigType getBlindedSigType()
public long getDate()
public Hash getDestHash()
public Destination getDestination()
public long getExpiration()
public String getSecret()
public boolean getSecretRequired()
public SigningPublicKey getUnblindedPubKey()
public void setAuthRequired()
public void setDate(long date)
date - the creation date in millisecondspublic void setDestination(Destination d)
d - the destination to setIllegalArgumentException - on SigningPublicKey mismatchpublic void setExpiration(long date)
date - the expiration date in millisecondspublic void setSecretRequired()
public String toBase32()