8002277: Refactor two PBE classes to simplify maintenance

Reviewed-by: weijun
This commit is contained in:
Valerie Peng 2022-05-17 20:55:34 +00:00
parent 141ef68f82
commit 61ddbef368
6 changed files with 356 additions and 573 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,8 @@ import javax.crypto.*;
* @since 1.5
* @author Andreas Sterbenz
*/
public final class ARCFOURCipher extends CipherSpi {
public sealed class ARCFOURCipher extends CipherSpi
permits PKCS12PBECipherCore.PBEWithSHA1AndRC4 {
// state array S, 256 entries. The entries are 8-bit, but we use an int[]
// because int arithmetic is much faster than in Java than bytes.