-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathKeyProvider.java
More file actions
36 lines (32 loc) · 933 Bytes
/
KeyProvider.java
File metadata and controls
36 lines (32 loc) · 933 Bytes
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
29
30
31
32
33
34
35
36
package com.safeheron.client;
import com.safeheron.client.config.RSATypeEnum;
/**
* KeyProvider interface for signing and decryption capabilities.
* This is the single extension point for self-managed key solutions.
*
* @author Jiahj
*/
public interface KeyProvider {
/**
* Sign content using RSA (PKCS#1 v1.5)
*
* @param content the content to sign
* @return the Base64-encoded signature
*/
String sign(String content);
/**
* Sign content using RSA-PSS
*
* @param content the content to sign
* @return the Base64-encoded RSA-PSS signature
*/
String signPSS(String content);
/**
* Decrypt content using RSA
*
* @param content the Base64-encoded encrypted content
* @param rsaType the RSA algorithm type used for decryption
* @return the decrypted raw byte array
*/
byte[] decrypt(String content, RSATypeEnum rsaType);
}