Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/465#discussion_r23522215
  
    --- Diff: 
core/src/test/java/brooklyn/util/crypto/SecureKeysAndSignerTest.java ---
    @@ -93,6 +95,40 @@ public void testReadRsaKey() throws Exception {
             checkNonTrivial(key);
         }
     
    +    @Test(expectedExceptions=IllegalStateException.class)
    +    public void testReadRsaPublicKeyAsPemFails() throws Exception {
    +        // should fail; see next test
    +        
SecureKeys.readPem(ResourceUtils.create(this).getResourceFromUrl("classpath://brooklyn/util/crypto/sample_rsa.pem.pub"),
 null);
    +    }
    +    
    +    @Test
    +    public void testReadRsaPublicKeyAsAuthKeysWorks() throws Exception {
    +        PublicKey key = AuthorizedKeysParser.decodePublicKey(
    +            
ResourceUtils.create(this).getResourceAsString("classpath://brooklyn/util/crypto/sample_rsa.pem.pub"));
    +        KeyPair fromPem = 
SecureKeys.readPem(ResourceUtils.create(this).getResourceFromUrl("classpath://brooklyn/util/crypto/sample_rsa.pem"),
 null);        
    --- End diff --
    
    maybe it is big enough rat can tell it isn't human readable?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to