~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to clc/modules/authentication/src/main/java/com/eucalyptus/auth/CredentialProvider.java

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
    EntityWrapper<X509Cert> db = Credentials.getEntityWrapper( );
106
106
    try {
107
107
      X509Cert certInfo = db.getUnique( new X509Cert( alias ) );
108
 
      byte[] certBytes = UrlBase64.decode( certInfo.getPemCertificate( ).getBytes( ) );
109
 
      X509Certificate x509 = Hashes.getPemCert( certBytes );
110
 
      db.commit( );
111
 
      return x509;
 
108
      String certString = certInfo.getPemCertificate();
 
109
      if(certString != null) {
 
110
          byte[] certBytes = UrlBase64.decode(certString.getBytes( ) );
 
111
          X509Certificate x509 = Hashes.getPemCert( certBytes );
 
112
          db.commit( );
 
113
          return x509;
 
114
      }
 
115
      return null;
112
116
    } catch ( EucalyptusCloudException e ) {
113
117
      db.rollback( );
114
118
      throw new GeneralSecurityException( e );