-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adrian Lapierre
committed
Dec 23, 2024
1 parent
075b4bc
commit 628e8af
Showing
6 changed files
with
52 additions
and
9 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
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
45 changes: 45 additions & 0 deletions
45
digital-signature/src/main/java/io/alapierre/crypto/dss/signer/CloudSignatureToken.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,45 @@ | ||
package io.alapierre.crypto.dss.signer; | ||
|
||
import eu.europa.esig.dss.token.AbstractSignatureTokenConnection; | ||
import eu.europa.esig.dss.token.DSSPrivateKeyEntry; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Adrian Lapierre {@literal [email protected]} | ||
* Copyrights by original author 29.06.2024 | ||
*/ | ||
public class CloudSignatureToken extends AbstractSignatureTokenConnection { | ||
|
||
private final String apiEndpoint; | ||
private final String apiKey; | ||
|
||
public CloudSignatureToken(String apiEndpoint, String apiKey) { | ||
this.apiEndpoint = apiEndpoint; | ||
this.apiKey = apiKey; | ||
} | ||
|
||
@Override | ||
public void close() { | ||
// Close any connections if necessary | ||
} | ||
|
||
@Override | ||
public List<DSSPrivateKeyEntry> getKeys() { | ||
// Implement method to retrieve keys from the cloud service | ||
// This might involve making an API call to list available keys | ||
return Collections.emptyList(); | ||
} | ||
|
||
public byte[] sign(byte[] dataToSign, String keyId) { | ||
// Implement method to send the data to the cloud API and get the signature | ||
// Use your API key and endpoint to make an HTTP request | ||
// Handle the response and return the signed data | ||
return null; | ||
} | ||
|
||
// Generate hash of the document | ||
//Digest digest = new Digest(DigestAlgorithm.SHA256, Utils.digest(DigestAlgorithm.SHA256, document)); | ||
// new SignatureValue(SignatureAlgorithm.RSA_SHA256, signedHash); | ||
} |
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