All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.solovyev.common.security.AndroidAesSecurityService Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package org.solovyev.common.security;

import org.jetbrains.annotations.NotNull;

/**
 * User: serso
 * Date: 8/20/12
 * Time: 8:24 PM
 */
public class AndroidAesSecurityService implements SecurityService {

    @NotNull
    private final Cipherer cipherer;

    @NotNull
    private final SecretKeyProvider secretKeyProvider;

    @NotNull
    private final SaltGenerator saltGenerator;

    @NotNull
    private final HashProvider hashProvider;

    public AndroidAesSecurityService() {
        cipherer = CiphererImpl.newAndroidAesCipherer();
        secretKeyProvider = PbeSecretKeyProvider.newAndroidDefaultInstance();
        saltGenerator = SaltGeneratorImpl.newAndroidDefaultInstance();
        hashProvider = HashProviderImpl.newAndroidDefaultInstance();
    }


    @NotNull
    @Override
    public SaltGenerator getSaltGenerator() {
        return saltGenerator;
    }

    @NotNull
    @Override
    public SecretKeyProvider getSecretKeyProvider() {
        return secretKeyProvider;
    }

    @NotNull
    @Override
    public HashProvider getHashProvider() {
        return hashProvider;
    }

    @NotNull
    @Override
    public Cipherer getCipherer() {
        return cipherer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy