public class DpApiProtectionService extends java.lang.Object implements IProtectionService
IProtectionService that uses the Windows DPAPI to protect data on either user oder machine scope.| Constructor and Description |
|---|
DpApiProtectionService(ProtectionScope protectionScope)
Constructor to create an instance with a certain protection scope.
|
| Modifier and Type | Method and Description |
|---|---|
ProtectionScope |
getProtectionScope()
Returns the protection scope that is used to protect the data.
|
byte[] |
protect(byte[] bytesToProtect)
Protects the given content, using Windows DPAPI.
|
byte[] |
unprotect(byte[] protectedBytes)
Unprotects the given content, using Windows DPAPI.
|
public DpApiProtectionService(ProtectionScope protectionScope)
protectionScope - machine or user scopepublic byte[] protect(byte[] bytesToProtect)
throws ClientException
protect in interface IProtectionServicebytesToProtect - The content to protect.ClientException - If the protection fails.public byte[] unprotect(byte[] protectedBytes)
throws ClientException
unprotect in interface IProtectionServiceprotectedBytes - The content to unprotect.ClientException - If the unprotection fails.public ProtectionScope getProtectionScope()
ProtectionScope.