public class FamilyKeyCrypto extends Object
| Modifier and Type | Class and Description |
|---|---|
static class | FamilyKeyCrypto.ResultOnly STORED_KEY is fully trusted. |
| Modifier and Type | Field and Description |
|---|---|
static String | CERT_SUFFIXCertificate file suffix |
static String | CN_SUFFIXCommon name suffix |
static String | CRL_SUFFIXCRL file suffix |
static String | KEYSTORE_PREFIXKeystore file prefix |
static String | KEYSTORE_SUFFIXKeystore file suffix |
static String | OPT_KEYOption key for family certificate |
static String | OPT_NAMEOption key for family name |
static String | OPT_SIGOption key for family signature |
static String | PROP_FAMILY_NAMEProperty key for family name |
static String | PROP_KEY_PASSWORDProperty key for key password |
static String | PROP_KEYSTORE_PASSWORDProperty key for keystore password |
| Constructor and Description |
|---|
FamilyKeyCrypto(RouterContext context)For signing and verification. |
| Modifier and Type | Method and Description |
|---|---|
Set<Hash> | getOurFamily()Get verified members of our family. |
String | getOurFamilyName()Get our family name. |
boolean | hasFamily()Do we have a valid family? |
static void | main(String[] args)CLI entry point for manual family key operations. |
void | shutdown()Clears the caches |
Map<String,String> | sign(String family,
Hash h)Caller must add family to RI also. |
FamilyKeyCrypto.Result | verify(RouterInfo ri)Verify the family signature in a RouterInfo. |
boolean | verifyOurFamily(RouterInfo ri)Verify the family in a RouterInfo matches ours and the signature is good. |
public static final String CERT_SUFFIX
public static final String CN_SUFFIX
public static final String CRL_SUFFIX
public static final String KEYSTORE_PREFIX
public static final String KEYSTORE_SUFFIX
public static final String OPT_KEY
public static final String OPT_NAME
public static final String OPT_SIG
public static final String PROP_FAMILY_NAME
public static final String PROP_KEY_PASSWORD
public static final String PROP_KEYSTORE_PASSWORD
public FamilyKeyCrypto(RouterContext context) throws GeneralSecurityException
GeneralSecurityExceptionpublic Set<Hash> getOurFamily()
public String getOurFamilyName()
public boolean hasFamily()
public static void main(String[] args)
public void shutdown()
public Map<String,String> sign(String family, Hash h) throws GeneralSecurityException
family - non-null, must match that we were initialized with or will throw GSEh - non-nullGeneralSecurityException - on null hash, null or changed family, or signing errorpublic FamilyKeyCrypto.Result verify(RouterInfo ri)
public boolean verifyOurFamily(RouterInfo ri)