mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-03 15:22:27 -08:00
Change packages and solve dependencies
This commit is contained in:
1 parent
94a8ecbdf1
commit
54740c1ba2
260 files changed
+1220
-1408
No files matched your search
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2017 Brian Pellin.
|
||||
*
|
||||
* This file is part of KeePassDroid.
|
||||
*
|
||||
* KeePassDroid is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDroid is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDroid. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.stream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
|
||||
public class MacOutputStream extends OutputStream {
|
||||
private Mac mac;
|
||||
private OutputStream os;
|
||||
|
||||
public MacOutputStream(OutputStream os, Mac mac) {
|
||||
this.mac = mac;
|
||||
this.os = os;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
os.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
os.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int oneByte) throws IOException {
|
||||
mac.update((byte) oneByte);
|
||||
os.write(oneByte);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] buffer, int offset, int count) throws IOException {
|
||||
mac.update(buffer, offset, count);
|
||||
os.write(buffer, offset, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] buffer) throws IOException {
|
||||
mac.update(buffer, 0, buffer.length);
|
||||
os.write(buffer);
|
||||
}
|
||||
|
||||
public byte[] getMac() {
|
||||
return mac.doFinal();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user