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

com.thelastcheck.commons.base.security.CredentialsReader Maven / Gradle / Ivy

There is a newer version: 2.5.2
Show newest version
/**
 * ****************************************************************************
 * The Last Check, LLC
 * 9499 Grove Trail Lane
 * Germantown, TN 38139
 * 

* Unauthorized distribution, adaptation or use may be subject to civil and * criminal penalties. *

* Copyright (c) 2015, The Last Check, LLC, All rights reserved. * **************************************************************************** */ package com.thelastcheck.commons.base.security; import com.google.common.io.ByteSource; import com.google.common.io.Files; import java.io.File; import java.io.IOException; public class CredentialsReader { private ByteSource source; public CredentialsReader(File file) { this(Files.asByteSource(file)); } public CredentialsReader(ByteSource source) { this.source = source; } public Credentials read() throws IOException, CredentialsEncryptionException { byte[] ba = source.read(); CredentialsEncrypter encrypter = new CredentialsEncrypter(); return encrypter.decrypt(ba); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy