Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4550425
commit 3c88bdd
Showing
33 changed files
with
340 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/EDDSA.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/XDH.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/curve/EdDSACurve.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/curve/XDHCurve.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/ecdsa/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2020 Paul Schaub. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Classes related to ECDSA. | ||
*/ | ||
package org.pgpainless.key.generation.type.ecdsa; |
50 changes: 50 additions & 0 deletions
50
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/eddsa/EdDSA.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2020 Paul Schaub. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.pgpainless.key.generation.type.eddsa; | ||
|
||
import java.security.spec.AlgorithmParameterSpec; | ||
|
||
import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec; | ||
import org.pgpainless.algorithm.PublicKeyAlgorithm; | ||
import org.pgpainless.key.generation.type.KeyType; | ||
|
||
public final class EdDSA implements KeyType { | ||
|
||
private final EdDSACurve curve; | ||
|
||
private EdDSA(EdDSACurve curve) { | ||
this.curve = curve; | ||
} | ||
|
||
public static EdDSA fromCurve(EdDSACurve curve) { | ||
return new EdDSA(curve); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "EdDSA"; | ||
} | ||
|
||
@Override | ||
public PublicKeyAlgorithm getAlgorithm() { | ||
return PublicKeyAlgorithm.EDDSA; | ||
} | ||
|
||
@Override | ||
public AlgorithmParameterSpec getAlgorithmSpec() { | ||
return new ECNamedCurveGenParameterSpec(curve.getName()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/eddsa/EdDSACurve.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2020 Paul Schaub. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.pgpainless.key.generation.type.eddsa; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public enum EdDSACurve { | ||
_Ed25519("ed25519"), | ||
; | ||
|
||
final String name; | ||
|
||
EdDSACurve(@Nonnull String curveName) { | ||
this.name = curveName; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
pgpainless-core/src/main/java/org/pgpainless/key/generation/type/eddsa/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2020 Paul Schaub. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Classes related to EdDSA. | ||
*/ | ||
package org.pgpainless.key.generation.type.eddsa; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.