blob: 0cfc988249e99343ce61f6e7facf43f07470ffb5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.ECGenParameterSpec;
import java.util.Optional;
/**
* @author bjorncs
*/
public enum KeyAlgorithm {
RSA("RSA", null),
EC("EC", new ECGenParameterSpec("prime256v1")); // TODO Make curve configurable
final String algorithmName;
private final AlgorithmParameterSpec spec;
KeyAlgorithm(String algorithmName, AlgorithmParameterSpec spec) {
this.algorithmName = algorithmName;
this.spec = spec;
}
String getAlgorithmName() {
return algorithmName;
}
Optional<AlgorithmParameterSpec> getSpec() { return Optional.ofNullable(spec); }
}
|