Class RegisteredServicePublicKeyCipherExecutor

  • All Implemented Interfaces:
    org.apereo.cas.services.RegisteredServiceCipherExecutor

    public class RegisteredServicePublicKeyCipherExecutor
    extends java.lang.Object
    implements org.apereo.cas.services.RegisteredServiceCipherExecutor
    Default cipher implementation based on public keys.
    Since:
    4.1
    • Field Summary

      • Fields inherited from interface org.apereo.cas.services.RegisteredServiceCipherExecutor

        CUSTOM_HEADER_REGISTERED_SERVICE_ID, DEFAULT_BEAN_NAME
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decode​(java.lang.String data, java.util.Optional<org.apereo.cas.services.RegisteredService> service)  
      java.lang.String encode​(java.lang.String data, java.util.Optional<org.apereo.cas.services.RegisteredService> service)
      Encrypt using the given cipher associated with the service, and encode the data in base 64.
      protected static byte[] encodeInternal​(java.lang.String data, org.apereo.cas.services.RegisteredService registeredService)
      Encode internally, meant to be called by extensions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apereo.cas.services.RegisteredServiceCipherExecutor

        encode, isEnabled, supports
    • Constructor Detail

      • RegisteredServicePublicKeyCipherExecutor

        public RegisteredServicePublicKeyCipherExecutor()
    • Method Detail

      • encode

        public java.lang.String encode​(java.lang.String data,
                                       java.util.Optional<org.apereo.cas.services.RegisteredService> service)
        Encrypt using the given cipher associated with the service, and encode the data in base 64.
        Specified by:
        encode in interface org.apereo.cas.services.RegisteredServiceCipherExecutor
        Parameters:
        data - the data
        service - the registered service
        Returns:
        the encoded piece of data in base64
      • decode

        public java.lang.String decode​(java.lang.String data,
                                       java.util.Optional<org.apereo.cas.services.RegisteredService> service)
        Specified by:
        decode in interface org.apereo.cas.services.RegisteredServiceCipherExecutor
      • encodeInternal

        protected static byte[] encodeInternal​(java.lang.String data,
                                               org.apereo.cas.services.RegisteredService registeredService)
        Encode internally, meant to be called by extensions. Default behavior will encode the data based on the registered service public key's algorithm using Cipher.
        Parameters:
        data - the data
        registeredService - the registered service
        Returns:
        a byte[] that contains the encrypted result