Interface Crypto
- All Known Implementing Classes:
CipherCrypto
public interface Crypto
Support for encrypting an entire database.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddecryptPage(long pageIndex, int pageSize, long pageAddr, int pageOffset) Called by multiple threads to decrypt a fixed-size database page.default voiddecryptPage(long pageIndex, int pageSize, long srcAddr, int srcOffset, long dstAddr, int dstOffset) Called by multiple threads to decrypt a fixed-size database page.default voidencryptPage(long pageIndex, int pageSize, long pageAddr, int pageOffset) Called by multiple threads to encrypt a fixed-size database page.default voidencryptPage(long pageIndex, int pageSize, long srcAddr, int srcOffset, long dstAddr, int dstOffset) Called by multiple threads to encrypt a fixed-size database page.Called to wrap an InputStream for supporting decryption.Called to wrap an OutputStream for supporting encryption.
-
Method Details
-
encryptPage
default void encryptPage(long pageIndex, int pageSize, long pageAddr, int pageOffset) throws GeneralSecurityException Called by multiple threads to encrypt a fixed-size database page. Encrypted length must exactly match original length.- Parameters:
pageIndex- page index within databasepageAddr- initially the original unencrypted page; replaced with encrypted pagepageOffset- offset into page- Throws:
GeneralSecurityException
-
encryptPage
default void encryptPage(long pageIndex, int pageSize, long srcAddr, int srcOffset, long dstAddr, int dstOffset) throws GeneralSecurityException Called by multiple threads to encrypt a fixed-size database page. Encrypted length must exactly match original length.- Parameters:
pageIndex- page index within databasesrcAddr- original unencrypted pagesrcOffset- offset into unencrypted pagedstAddr- destination for encrypted pagedstOffset- offset into encrypted page- Throws:
GeneralSecurityException
-
decryptPage
default void decryptPage(long pageIndex, int pageSize, long pageAddr, int pageOffset) throws GeneralSecurityException Called by multiple threads to decrypt a fixed-size database page. Decrypted length must exactly match encrypted length.- Parameters:
pageIndex- page index within databasepageAddr- initially the encrypted page; replaced with decrypted pagepageOffset- offset into page- Throws:
GeneralSecurityException
-
decryptPage
default void decryptPage(long pageIndex, int pageSize, long srcAddr, int srcOffset, long dstAddr, int dstOffset) throws GeneralSecurityException Called by multiple threads to decrypt a fixed-size database page. Decrypted length must exactly match encrypted length.- Parameters:
pageIndex- page index within databasesrcAddr- encrypted pagesrcOffset- offset into encrypted pagedstAddr- destination for decrypted pagedstOffset- offset into decrypted page- Throws:
GeneralSecurityException
-
newEncryptingStream
Called to wrap an OutputStream for supporting encryption. Implementation of this method must be thread-safe, but the stream doesn't need to be.- Parameters:
out- encrypted data destination- Returns:
- stream which encrypts all data
- Throws:
GeneralSecurityExceptionIOException
-
newDecryptingStream
Called to wrap an InputStream for supporting decryption. Implementation of this method must be thread-safe, but the stream doesn't need to be.- Parameters:
in- encrypted data source- Returns:
- stream which decrypts all data
- Throws:
GeneralSecurityExceptionIOException
-