<commit_before>package data.contents;

import data.Content;

import java.security.PublicKey;

/**
 * @author <NAME>
 * @version 12/1/13
 */
public class PublicKeyResponse extends Content {
    private String requestId;
    private PublicKey publicKey;

    /**
     * Constructs a public key response, which will be sent back
     * from the server as a response of the PublicKeyRequest
     * @param requestId the id of the requested user
     * @param publicKey the public key of the requested user
     */
    public PublicKeyResponse(String requestId, PublicKey publicKey) {
        this.type = Type.PUBLIC_KEY_RESPONSE;
        this.requestId = requestId;
        this.publicKey = publicKey;
    }

    /**
     * @return the string
     */
    @Override
    public String toString() {
        return "Public key of " + requestId + " is inside";
    }

    /**
     * Returns the request id
     * @return the request id
     */
    public String getRequestId() {
        return requestId;
    }

    /**
     * Return the public key
     * @return the public key
     */
    public PublicKey getPublicKey() {
        return publicKey;
    }

    /**
     * Return if the user exists
     * @return whether the user exists or not
     */
    boolean userNotExisting(){
        return publicKey == null;
    }
}<commit_msg>Public key response byte[] fix<commit_after>package data.contents;

import crypto.Cryptography;
import data.Content;

import java.security.PublicKey;

/**
 * @author <NAME>
 * @version 12/1/13
 */
public class PublicKeyResponse extends Content {
    private String requestId;
    private byte[] publicKey;

    /**
     * Constructs a public key response, which will be sent back
     * from the server as a response of the PublicKeyRequest
     *
     * @param requestId the id of the requested user
     * @param publicKey the public key of the requested user
     */
    public PublicKeyResponse(String requestId, PublicKey publicKey) {
        this.type = Type.PUBLIC_KEY_RESPONSE;
        this.requestId = requestId;
        this.publicKey = publicKey.getEncoded();
    }

    /**
     * @return the string
     */
    @Override
    public String toString() {
        return "Public key of " + requestId + " is inside";
    }

    /**
     * Returns the request id
     *
     * @return the request id
     */
    public String getRequestId() {
        return requestId;
    }

    /**
     * Return the public key
     *
     * @return the public key
     */
    public PublicKey getPublicKey() {
        return Cryptography.getPublicKeyFromBytes(publicKey);
    }

    /**
     * Return if the user exists
     *
     * @return whether the user exists or not
     */
    boolean userNotExisting() {
        return publicKey == null;
    }
}
{'fraction_non_alphanumeric': 0.08795962509012256, 'fraction_numerical': 0.003604902667627974, 'mean_word_length': 2.253223915592028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5823211', 'n_tokens_mistral': 785, 'n_tokens_neox': 765, 'n_words': 256}