Package org.openid4java.association

Examples of org.openid4java.association.AssociationException


            // is supported / allowed ?
            if (! Association.isHmacSupported(type.getAssociationType()) ||
                    ! DiffieHellmanSession.isDhSupported(type) ||
                    _minAssocSessEnc.isBetter(type))
            {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
View Full Code Here


            }

            attemptsLeft--;
        }

        throw new AssociationException(
                "JDBCServerAssociationStore: Error generating association.");
    }
View Full Code Here

            String type = (String) res.get("type");
            String macKey = (String) res.get("mackey");
            Date expDate = (Date) res.get("expdate");

            if (type == null || macKey == null || expDate == null)
                throw new AssociationException("Invalid association data " +
                        "retrived from database; cannot create Association " +
                        "object for handle: " + handle);

            Association assoc;

            if (Association.TYPE_HMAC_SHA1.equals(type))
                assoc = Association.createHmacSha1(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else if (Association.TYPE_HMAC_SHA256.equals(type))
                assoc = Association.createHmacSha256(handle,
                        Base64.decodeBase64(macKey.getBytes() ), expDate);

            else
                throw new AssociationException("Invalid association type " +
                        "retrieved from database: " + type);

            if (DEBUG)
                _log.debug("Retrieved association for handle: " + handle +
                           " from table: " + _tableName);
View Full Code Here

        else if (Association.TYPE_HMAC_SHA256.equals(type.getAssociationType()))
            assoc = Association.createHmacSha256(handle, macKey, expiresIn);

        else
            throw new AssociationException("Unknown association type: " + type);

        if (DEBUG) _log.debug("Created association for handle: " + handle);

        return assoc;
    }
View Full Code Here

      String type = (String) res.get ( "type" ) ;
      String macKey = (String) res.get ( "mackey" ) ;
      Date expDate = (Date) res.get ( "expdate" ) ;

      if ( type == null || macKey == null || expDate == null )
        throw new AssociationException (
                          "Invalid association data retrived from database; cannot create Association "
                              + "object for handle: "
                              + handle ) ;

      Association assoc ;

      if ( Association.TYPE_HMAC_SHA1.equals ( type ) )
        assoc = Association.createHmacSha1 handle,
                            Base64.decodeBase64 ( macKey.getBytes ( ) ),
                            expDate ) ;

      else if ( Association.TYPE_HMAC_SHA256.equals ( type ) )
        assoc = Association.createHmacSha256 handle,
                            Base64.decodeBase64 ( macKey.getBytes ( ) ),
                            expDate ) ;

      else
        throw new AssociationException (
                          "Invalid association type "
                              + "retrieved from database: "
                              + type ) ;

      if ( _log.isDebugEnabled ( ) )
View Full Code Here

      Association assoc ;

            if ( expDate == null || ( type == null || macKey == null ) &&
                 ! Association.FAILED_ASSOC_HANDLE.equals(handle) ) {
        throw new AssociationException (
                          "Invalid expiry date retrived from database; cannot create Association "
                              + "object for handle: "
                              + handle ) ;

            } else if (Association.FAILED_ASSOC_HANDLE.equals(handle)) {
                assoc = Association.getFailedAssociation(expDate);

            } else if ( Association.TYPE_HMAC_SHA1.equals ( type ) ) {
        assoc = Association.createHmacSha1 handle,
                            Base64.decodeBase64 ( macKey.getBytes ( ) ),
                            expDate ) ;

            } else if ( Association.TYPE_HMAC_SHA256.equals ( type ) ) {
        assoc = Association.createHmacSha256 handle,
                            Base64.decodeBase64 ( macKey.getBytes ( ) ),
                            expDate ) ;

            } else {
        throw new AssociationException (
                          "Invalid association type "
                              + "retrieved from database: "
                              + type ) ;

            }
View Full Code Here

            // is supported / allowed ?
            if (! Association.isHmacSupported(type.getAssociationType()) ||
                    ! DiffieHellmanSession.isDhSupported(type) ||
                    _minAssocSessEnc.isBetter(type))
            {
                throw new AssociationException("Unable create association for: "
                        + type.getSessionType() + " / "
                        + type.getAssociationType() );
            }
            else // all ok, go ahead
            {
View Full Code Here

TOP

Related Classes of org.openid4java.association.AssociationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.