/** {@inheritDoc} */ public Boolean evaluate(Credential target) { if (target == null) { log.error("Credential target was null"); return null; } Key key = getKey(target); if (key == null) { log.info("Could not evaluate criteria, credential contained no key"); return null; } Integer length = SecurityHelper.getKeyLength(key); if (length == null) { log.info("Could not evaluate criteria, can not determine length of key"); return null; } Boolean result = keyLength.equals(length); return result; }
/** {@inheritDoc} */ public Boolean evaluate(Credential target) { if (target == null) { log.error("Credential target was null"); return null; } Key key = getKey(target); if (key == null) { log.info("Could not evaluate criteria, credential contained no key"); return null; } Integer length = SecurityHelper.getKeyLength(key); if (length == null) { log.info("Could not evaluate criteria, can not determine length of key"); return null; } Boolean result = keyLength.equals(length); return result; }
/** {@inheritDoc} */ public String getKeyTransportEncryptionAlgorithmURI(Credential credential, String wrappedKeyAlgorithm) { Key key = SecurityHelper.extractEncryptionKey(credential); if (key == null) { log.debug("Could not extract key transport encryption key from credential, unable to map to algorithm URI"); return null; } else if (key.getAlgorithm() == null){ log.debug("Key transport encryption key algorithm value was not available, unable to map to algorithm URI"); return null; } Integer length = SecurityHelper.getKeyLength(key); return getKeyTransportEncryptionAlgorithmURI(key.getAlgorithm(), length, wrappedKeyAlgorithm); }
/** {@inheritDoc} */ public String getKeyTransportEncryptionAlgorithmURI(Credential credential, String wrappedKeyAlgorithm) { Key key = SecurityHelper.extractEncryptionKey(credential); if (key == null) { log.debug("Could not extract key transport encryption key from credential, unable to map to algorithm URI"); return null; } else if (key.getAlgorithm() == null){ log.debug("Key transport encryption key algorithm value was not available, unable to map to algorithm URI"); return null; } Integer length = SecurityHelper.getKeyLength(key); return getKeyTransportEncryptionAlgorithmURI(key.getAlgorithm(), length, wrappedKeyAlgorithm); }
/** {@inheritDoc} */ public String getDataEncryptionAlgorithmURI(Credential credential) { Key key = SecurityHelper.extractEncryptionKey(credential); if (key == null) { log.debug("Could not extract data encryption key from credential, unable to map to algorithm URI"); return null; } else if (key.getAlgorithm() == null){ log.debug("Data encryption key algorithm value was not available, unable to map to algorithm URI"); return null; } Integer length = SecurityHelper.getKeyLength(key); return getDataEncryptionAlgorithmURI(key.getAlgorithm(), length); }
/** {@inheritDoc} */ public String getDataEncryptionAlgorithmURI(Credential credential) { Key key = SecurityHelper.extractEncryptionKey(credential); if (key == null) { log.debug("Could not extract data encryption key from credential, unable to map to algorithm URI"); return null; } else if (key.getAlgorithm() == null){ log.debug("Data encryption key algorithm value was not available, unable to map to algorithm URI"); return null; } Integer length = SecurityHelper.getKeyLength(key); return getDataEncryptionAlgorithmURI(key.getAlgorithm(), length); }