Class KeyBuilders.Asymmetric
java.lang.Object
zeroecho.sdk.KeyBuilders.Asymmetric
- Enclosing class:
KeyBuilders
Asymmetric generation and import lookups.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescription<S extends AlgorithmKeySpec>
KeyPairgenerateKeyPair(String algorithmId, S spec) Generates a key pair using the exact runtime specification type.<S extends AlgorithmKeySpec>
PrivateKeyimportPrivate(String algorithmId, S spec) Imports a private key using the exact runtime specification type.<S extends AlgorithmKeySpec>
PublicKeyimportPublic(String algorithmId, S spec) Imports a public key using the exact runtime specification type.<S extends AlgorithmKeySpec>
AsymmetricKeyPairGenerator<S> keyPairGenerator(String algorithmId, Class<S> specType) Resolves an exact key-pair generator.<S extends AlgorithmKeySpec>
PrivateKeyImporter<S> privateImporter(String algorithmId, Class<S> specType) Resolves an exact private-key importer.<S extends AlgorithmKeySpec>
PublicKeyImporter<S> publicImporter(String algorithmId, Class<S> specType) Resolves an exact public-key importer.
-
Method Details
-
keyPairGenerator
public <S extends AlgorithmKeySpec> AsymmetricKeyPairGenerator<S> keyPairGenerator(String algorithmId, Class<S> specType) Resolves an exact key-pair generator.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspecType- exact specification class- Returns:
- guaranteed generator
- Throws:
IllegalArgumentException- if the capability is absent
-
publicImporter
public <S extends AlgorithmKeySpec> PublicKeyImporter<S> publicImporter(String algorithmId, Class<S> specType) Resolves an exact public-key importer.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspecType- exact specification class- Returns:
- guaranteed importer
- Throws:
IllegalArgumentException- if the capability is absent
-
privateImporter
public <S extends AlgorithmKeySpec> PrivateKeyImporter<S> privateImporter(String algorithmId, Class<S> specType) Resolves an exact private-key importer.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspecType- exact specification class- Returns:
- guaranteed importer
- Throws:
IllegalArgumentException- if the capability is absent
-
generateKeyPair
public <S extends AlgorithmKeySpec> KeyPair generateKeyPair(String algorithmId, S spec) throws GeneralSecurityException Generates a key pair using the exact runtime specification type.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspec- generation specification- Returns:
- generated key pair
- Throws:
GeneralSecurityException- if generation failsIllegalArgumentException- if the capability is absentNullPointerException- ifspecisnull
-
importPublic
public <S extends AlgorithmKeySpec> PublicKey importPublic(String algorithmId, S spec) throws GeneralSecurityException Imports a public key using the exact runtime specification type.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspec- public-key import specification- Returns:
- imported public key
- Throws:
GeneralSecurityException- if import failsIllegalArgumentException- if the capability is absentNullPointerException- ifspecisnull
-
importPrivate
public <S extends AlgorithmKeySpec> PrivateKey importPrivate(String algorithmId, S spec) throws GeneralSecurityException Imports a private key using the exact runtime specification type.- Type Parameters:
S- specification type- Parameters:
algorithmId- canonical algorithm identifierspec- private-key import specification- Returns:
- imported private key
- Throws:
GeneralSecurityException- if import failsIllegalArgumentException- if the capability is absentNullPointerException- ifspecisnull
-