MacData ::= SEQUENCE {
mac DigestInfo,
macSalt OCTET STRING,
iterations INTEGER DEFAULT 1
-- Note: The default is for historical reasons and its use is
-- deprecated.
}
DigestInfo ::= SEQUENCE {
digestAlgorithm DigestAlgorithmIdentifier,
digest OCTET STRING
}
| Modifier and Type | Field and Description |
|---|---|
| private static final Debug | |
| private final byte[] | |
| private final String | |
| private final int | |
| private final String | |
| private final int | |
| private final String | |
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static byte[] | Returns: the computed MAC as a byte arraythe algorithm used to compute the MAC macAlgorithm, char[] the password used to generate the key password, PBEParameterSpec a PBEParameterSpec object params, byte[] the data on which the MAC is computed data, String the pseudorandom function used to compute the key
for PBMAC1 kdfHmac, String the algorithm used to compute the MAC hmac, int the length of the key generated by the pseudorandom
function keyLength)Computes a MAC on the data. |
| pack-priv static byte[] | Returns: the ASN.1 encodingReturns the ASN.1 encoding. |
| pack-priv static byte[] | |
| pack-priv int | |
| pack-priv String | |
| private static String | |
| private static String | |
| pack-priv void | verifyMac(char[]
the password used to generate the key password, byte[] the data on which the MAC is computed data)Verify Mac on the data. |
| debug | back to summary |
|---|---|
| private static final Debug debug | |
| digest | back to summary |
|---|---|
| private final byte[] digest | |
| hmac | back to summary |
|---|---|
| private final String hmac | |
| iterations | back to summary |
|---|---|
| private final int iterations | |
| kdfHmac | back to summary |
|---|---|
| private final String kdfHmac | |
| keyLength | back to summary |
|---|---|
| private final int keyLength | |
| macAlgorithm | back to summary |
|---|---|
| private final String macAlgorithm | |
| macSalt | back to summary |
|---|---|
| private final byte[] macSalt | |
| MacData | back to summary |
|---|---|
| pack-priv MacData(DerInputStream derin) throws IOException Parses a PKCS#12 MAC data. | |
| calculateMac | back to summary |
|---|---|
| private static byte[] calculateMac(String macAlgorithm, char[] password, PBEParameterSpec params, byte[] data, String kdfHmac, String hmac, int keyLength) throws InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException Computes a MAC on the data. This is a two-step process: first generate a key and then use the key to generate the MAC. PBMAC1 and non-PBMAC1 keys use different key factories. PBMAC1 uses a pseudorandom function (kdfHmac) to generate keys while non-PBMAC1 does not. The MAC is computed according to the specified hmac algorithm.
| |
| encode | back to summary |
|---|---|
| pack-priv static byte[] encode(String algName, byte[] digest, PBEParameterSpec p, String kdfHmac, String hmac, int keyLength) throws IOException, NoSuchAlgorithmException Returns the ASN.1 encoding.
| |
| generateMac | back to summary |
|---|---|
| pack-priv static byte[] generateMac(char[] passwd, byte[] data, String macAlgorithm, int macIterationCount, byte[] salt) throws IOException, NoSuchAlgorithmException | |
| getIterations | back to summary |
|---|---|
| pack-priv int getIterations() | |
| getMacAlgorithm | back to summary |
|---|---|
| pack-priv String getMacAlgorithm() | |
| parseHmac | back to summary |
|---|---|
| private static String parseHmac(String text) | |
| parseKdfHmac | back to summary |
|---|---|
| private static String parseKdfHmac(String text) | |
| verifyMac | back to summary |
|---|---|
| pack-priv void verifyMac(char[] password, byte[] data) throws InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, UnrecoverableKeyException Verify Mac on the data. Calculate Mac on the data and compare with Mac found in input stream.
| |