// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.operator.bc;

import java.io.IOException;
import org.bouncycastle.crypto.util.PublicKeyFactory;
import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.crypto.signers.Ed25519Signer;
import org.bouncycastle.crypto.signers.Ed448Signer;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.edec.EdECObjectIdentifiers;
import org.bouncycastle.crypto.Signer;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;

public class BcEdDSAContentVerifierProviderBuilder extends BcContentVerifierProviderBuilder
{
    public static final byte[] DEFAULT_CONTEXT;
    
    @Override
    protected Signer createSigner(final AlgorithmIdentifier algorithmIdentifier) throws OperatorCreationException {
        if (algorithmIdentifier.getAlgorithm().equals(EdECObjectIdentifiers.id_Ed448)) {
            return new Ed448Signer(BcEdDSAContentVerifierProviderBuilder.DEFAULT_CONTEXT);
        }
        return new Ed25519Signer();
    }
    
    @Override
    protected AsymmetricKeyParameter extractKeyParameters(final SubjectPublicKeyInfo subjectPublicKeyInfo) throws IOException {
        return PublicKeyFactory.createKey(subjectPublicKeyInfo);
    }
    
    static {
        DEFAULT_CONTEXT = new byte[0];
    }
}
