Sunbit v2.4.4版本的 MD5 值为:a5021e5e2a58eb1d6741b432fe7533c4

以下内容为反编译后的 i.java 源代码,内容仅作参考


package d.b.h.j;

import java.security.KeyPair;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Collection;
import java.util.Set;
public class i extends d<i> {
    protected Signature f9834e;

    public i(j jVar) {
        this(jVar, (byte[]) null, (byte[]) null);
    }

    public Signature f() {
        return this.f9834e;
    }

    public i(String str) {
        this(str, (byte[]) null, (byte[]) null);
    }

    @Override
    public i a(String str, PrivateKey privateKey, PublicKey publicKey) {
        try {
            this.f9834e = Signature.getInstance(str);
            super.a(str, privateKey, publicKey);
            return this;
        } catch (NoSuchAlgorithmException e2) {
            throw new d.b.h.b(e2);
        }
    }

    public i(j jVar, String str, String str2) {
        this(jVar.a(), d.b.h.h.d(str), d.b.h.h.d(str2));
    }

    public i(j jVar, byte[] bArr, byte[] bArr2) {
        this(jVar.a(), bArr, bArr2);
    }

    public i(j jVar, KeyPair keyPair) {
        this(jVar.a(), keyPair);
    }

    public byte[] a(byte[] bArr) {
        this.f9816d.lock();
        try {
            try {
                this.f9834e.initSign(this.c);
                this.f9834e.update(bArr);
                return this.f9834e.sign();
            } catch (Exception e2) {
                throw new d.b.h.b(e2);
            }
        } finally {
            this.f9816d.unlock();
        }
    }

    public i(j jVar, PrivateKey privateKey, PublicKey publicKey) {
        this(jVar.a(), privateKey, publicKey);
    }

    public i(String str, String str2, String str3) {
        this(str, d.b.f.e.e.a(str2), d.b.f.e.e.a(str3));
    }

    public i(String str, byte[] bArr, byte[] bArr2) {
        this(str, d.b.h.h.c(str, bArr), d.b.h.h.d(str, bArr2));
    }

    public i(String str, KeyPair keyPair) {
        this(str, keyPair.getPrivate(), keyPair.getPublic());
    }

    public i(String str, PrivateKey privateKey, PublicKey publicKey) {
        super(str, privateKey, publicKey);
    }

    public boolean a(byte[] bArr, byte[] bArr2) {
        this.f9816d.lock();
        try {
            try {
                this.f9834e.initVerify(this.b);
                this.f9834e.update(bArr);
                return this.f9834e.verify(bArr2);
            } catch (Exception e2) {
                throw new d.b.h.b(e2);
            }
        } finally {
            this.f9816d.unlock();
        }
    }

    public i a(Signature signature) {
        this.f9834e = signature;
        return this;
    }

    public i a(Certificate certificate) {
        boolean[] keyUsage;
        if (certificate instanceof X509Certificate) {
            X509Certificate x509Certificate = (X509Certificate) certificate;
            Set<String> criticalExtensionOIDs = x509Certificate.getCriticalExtensionOIDs();
            if (d.b.f.f.c.d((Collection<?>) criticalExtensionOIDs) && criticalExtensionOIDs.contains("2.5.29.15") && (keyUsage = x509Certificate.getKeyUsage()) != null && !keyUsage[0]) {
                throw new d.b.h.b("Wrong key usage");
            }
        }
        this.b = certificate.getPublicKey();
        return this;
    }
}