OpenJDK / amber / amber
changeset 6294:27667aff0e1b
Merge
author | mullan |
---|---|
date | Tue, 03 Aug 2010 09:55:29 -0400 |
parents | 9da761dff0c7 796f1f45fcb8 |
children | 91f1c55cf47e |
files | |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/share/classes/java/security/KeyStore.java Tue Aug 03 12:03:03 2010 +0100 +++ b/jdk/src/share/classes/java/security/KeyStore.java Tue Aug 03 09:55:29 2010 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, 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 @@ -131,17 +131,19 @@ * to read existing entries from the keystore, or to write new entries * into the keystore: * <pre> + * KeyStore.ProtectionParameter protParam = + * new KeyStore.PasswordProtection(password); + * * // get my private key * KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry) - * ks.getEntry("privateKeyAlias", password); + * ks.getEntry("privateKeyAlias", protParam); * PrivateKey myPrivateKey = pkEntry.getPrivateKey(); * * // save my secret key * javax.crypto.SecretKey mySecretKey; * KeyStore.SecretKeyEntry skEntry = * new KeyStore.SecretKeyEntry(mySecretKey); - * ks.setEntry("secretKeyAlias", skEntry, - * new KeyStore.PasswordProtection(password)); + * ks.setEntry("secretKeyAlias", skEntry, protParam); * * // store away the keystore * java.io.FileOutputStream fos = null;