Class KeyBuilders.Symmetric
java.lang.Object
zeroecho.sdk.KeyBuilders.Symmetric
- Enclosing class:
KeyBuilders
Symmetric generation and import lookups.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescription<S extends AlgorithmKeySpec>
SecretKeyGenerates a symmetric key using the exact runtime specification type.<S extends AlgorithmKeySpec>
SymmetricKeyGenerator<S> Resolves an exact symmetric generator.<S extends AlgorithmKeySpec>
SymmetricKeyImporter<S> Resolves an exact symmetric importer.<S extends AlgorithmKeySpec>
SecretKeyImports a symmetric key using the exact runtime specification type.
-
Method Details
-
generator
public <S extends AlgorithmKeySpec> SymmetricKeyGenerator<S> generator(String algorithmId, Class<S> specType) Resolves an exact symmetric generator.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspecType- exact specification class- Returns:
- guaranteed generator
- Throws:
IllegalArgumentException- if the capability is absent
-
importer
public <S extends AlgorithmKeySpec> SymmetricKeyImporter<S> importer(String algorithmId, Class<S> specType) Resolves an exact symmetric importer.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspecType- exact specification class- Returns:
- guaranteed importer
- Throws:
IllegalArgumentException- if the capability is absent
-
generate
public <S extends AlgorithmKeySpec> SecretKey generate(String algorithmId, S spec) throws GeneralSecurityException Generates a symmetric key using the exact runtime specification type.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspec- generation specification- Returns:
- generated secret key
- Throws:
GeneralSecurityException- if generation failsIllegalArgumentException- if the capability is absentNullPointerException- ifspecisnull
-
importKey
public <S extends AlgorithmKeySpec> SecretKey importKey(String algorithmId, S spec) throws GeneralSecurityException Imports a symmetric key using the exact runtime specification type.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspec- import specification- Returns:
- imported secret key
- Throws:
GeneralSecurityException- if import failsIllegalArgumentException- if the capability is absentNullPointerException- ifspecisnull
-