jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
changeset 9508 310b4f6c8e61
parent 5506 202f599c92aa
--- a/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java	Thu Apr 21 17:00:23 2011 +0100
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java	Thu Apr 21 19:05:29 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
@@ -105,14 +105,20 @@
     // generate the keypair. See JCA doc
     public KeyPair generateKeyPair() {
 
-        // Generate each keypair in a unique key container
-        RSAKeyPair keys =
-            generateRSAKeyPair(keySize,
-                "{" + UUID.randomUUID().toString() + "}");
+        try {
 
-        return new KeyPair(keys.getPublic(), keys.getPrivate());
+            // Generate each keypair in a unique key container
+            RSAKeyPair keys =
+                generateRSAKeyPair(keySize,
+                    "{" + UUID.randomUUID().toString() + "}");
+
+            return new KeyPair(keys.getPublic(), keys.getPrivate());
+
+        } catch (KeyException e) {
+            throw new ProviderException(e);
+        }
     }
 
     private static native RSAKeyPair generateRSAKeyPair(int keySize,
-        String keyContainerName);
+        String keyContainerName) throws KeyException;
 }